Copy/paste formula to variable # of data

Solved/Closed
Beginner Macro User - Nov 13, 2011 at 04:53 PM
 B - Nov 20, 2011 at 06:30 PM
Hello,

I'm recording a macro where I have data in Col A (it's variable, it can be 5K rows one month, 6K rows another month). I want to copy a formula in col B based on the data in col A. Hence my problem with it being variable.

Thank you!

1 reply

venkat1926
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
810
Nov 14, 2011 at 04:51 AM
not clear. whatever be the length of colun A and you are having a formula in B1(or B2 if B1 is column heding) you can copy B2 down provided you take care of absolute and relative references of cells in the formula

post the formula in B2
0
Sorry my question wasn't clear but I'm recording a macro and I found this code in this forum and it worked beautifully! Exactly what I was looking for.

Selection.AutoFill Destination:=Range("B7:H" & Range("A" & Rows.Count).End(xlUp).Row)
0