I dun understand..however...
I want to clarify..is End(Excel.XlDirection) the right function to find last used cell in that specific column?
Have been cracking my brain and looking thru threads in my weekend but still isnt getting anywhere.
here's the code I tried:
Dim rng As Excel.Range
Dim colNum As Integer
colNum = 2
rng = WSheet.Cells(WSheet.Rows.Count, colNum)._
.HasTitle = True
.AxisTitle.Characters.Text = "Time"
.HasMajorGridlines = True
.HasMinorGridlines = True
.MinimumScale = 0.479166666666667
.MaximumScale = rng.Value '0.486111111111111
.MinorUnit = 0.000347222222222222
.MajorUnit = 0.000694444444444444
.Crosses = XlAxisCrosses.xlAxisCrossesAutomatic
.ReversePlotOrder = False
.ScaleType = XlScaleType.xlScaleLinear
.TickLabels.Orientation = XlTickLabelOrientation._
The whole graph's x-axis went hay wire.
I place the rng.value at ".MaximumScale = rng.Value '0.486111111111111"
And '0.486111111111111 is actually the value I enter initially which the graph work perfectly.
'0.486111111111111 refer to the last cell i select in the 2nd column "B" (time column), which is actually 11:40:00 and the excel convert it to 0.486111111111111.
But I want the program to select last cell itself instead of me selecting it.
I'm not sure if I am using the correct function.
I also tried this code:
rangEndTime = WSheet.UsedRange._
.MaximumScale = rangEndTime.ToString '0.486111111111111
The graph still haywire as well.