Hi, I'm trying to figure out the following. (was orinally posted in a VB forum but was suggested I use this one)
I have a macro within Excel which performs the autofill function such as this:
yearperiod = Application.InputBox _
("Enter the Year Period in the form of Tyyyypp")
Range("B1").Formula = yearperiod
Range("B1").Select
Selection.AutoFill Destination:=Range("B1:B4431")
Range("B1:B4431").Select
Selection.FillDown
I wish to make the lower limit of the autofill a variable that reacts to the last row in column A.
I know that typing =ROW(OFFSET(A1,COUNTA(A:A)-1,0))into any free cell on the worksheet will tell me there are 4431 rows in within column A, but I can't work out how to incorporate this into the macro.
Thanks in advance
I have a macro within Excel which performs the autofill function such as this:
yearperiod = Application.InputBox _
("Enter the Year Period in the form of Tyyyypp")
Range("B1").Formula = yearperiod
Range("B1").Select
Selection.AutoFill Destination:=Range("B1:B4431")
Range("B1:B4431").Select
Selection.FillDown
I wish to make the lower limit of the autofill a variable that reacts to the last row in column A.
I know that typing =ROW(OFFSET(A1,COUNTA(A:A)-1,0))into any free cell on the worksheet will tell me there are 4431 rows in within column A, but I can't work out how to incorporate this into the macro.
Thanks in advance