Can you please help me?
I am new to vba, so please bear with me.
I have the following code in my macro:
Range("J2:N2").Select
Selection.AutoFill Destination:=Range("J2:N23")
I think the first row of the code is copying the formula in row 2 of columns J to N. I think the 2nd row of the code is autofilling the cells from 2nd row to row 23.
My problem is: what if I have more rows than 23 rows, how should this code look if I want to fill the formula in row 2 to the end of the rows available.
Thanks very much for helping.
SharonMee
I am new to vba, so please bear with me.
I have the following code in my macro:
Range("J2:N2").Select
Selection.AutoFill Destination:=Range("J2:N23")
I think the first row of the code is copying the formula in row 2 of columns J to N. I think the 2nd row of the code is autofilling the cells from 2nd row to row 23.
My problem is: what if I have more rows than 23 rows, how should this code look if I want to fill the formula in row 2 to the end of the rows available.
Thanks very much for helping.
SharonMee