I am getting total number of rows, and now trying to auofill for this number in excel spreadseet that is currently open
for some reasons some times it works, other doesn't.
is there an issue with the tab staying active ?
for some reasons some times it works, other doesn't.
is there an issue with the tab staying active ?
Code:
'expand the formula
objActiveWkb.Worksheets("YTD").Select
Range("X2").Select
X = "X2:X" & TotalRows
Selection.AutoFill Destination:=Range(X)