Macro to fill down in a range [Solved/Closed]

 lee -

Thanks to all who provide help on this site. I'm new to writing macros so hopefully you might be able to steer me in the right direction with a macro. I have data that I copy in each week to the first seven columns and then add formulas in columns to the right and copy them down to the last row used. Each week the list can be 70 rows or 700. So I've tried to setup a marco to fill down my formula to the last row. I found a great piece of a macro on this site to find the last row number that has data. buidling on the macro I tried to set the range to filldown using the value of the last row used. however I keep getting a compile error when I use the rNum to indicate my row. Below is what I've tried.

Thanks for all your help in advance


Sub filldown()
Dim rNum As Long
rNum = Cells.Find(What:="*", After:=Range("a1"), _
SearchOrder:=xlByRows, _

ActiveCell.FormulaR1C1 = "=RC[-2]&"" 48"""

End Sub

2 replies

Change this line of code.


Change to this....correct:
Range("H1", Cells(rNum, 8)).Select
Thanks. It works perfect now!!!


Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!