VBAProIWish
Well-known Member
- Joined
- Jul 6, 2009
- Messages
- 1,027
- Office Version
- 365
- Platform
- Windows
Hello All,
Using the macro recorder, I have this code below that currently autofills down to row 444.
The only problem is that the next time I run this macro, the row count will be different. I would like it to stop autofilling Column B once it is equal to the last row of data in column A.
I did a search and saw this code here from VoG...
...and tried this here...
But it didn't work.
Can anyone help me with this one?
Thanks
Using the macro recorder, I have this code below that currently autofills down to row 444.
Code:
Range("B2").Select
ActiveCell.FormulaR1C1 = "=TEXT(RC[-1],""MMMM"")"
Range("B2").Select
Selection.AutoFill Destination:=Range("B2:B444")
The only problem is that the next time I run this macro, the row count will be different. I would like it to stop autofilling Column B once it is equal to the last row of data in column A.
I did a search and saw this code here from VoG...
Code:
Dim LR As Long
LR = Range("H" & Rows.Count).End(xlUp).Row
Range("I4").AutoFill Destination:=Range("I4:I" & LR)
...and tried this here...
Code:
Sub Autofill()
Dim LR As Long
Range("B2").Select
ActiveCell.FormulaR1C1 = "=TEXT(RC[-1],""MMMM"")"
Range("B2").Select
LR = Range("A" & Rows.Count).End(xlUp).Row
Range("B2").AutoFill Destination:=Range("B2:B" & LR)
End Sub
But it didn't work.
Can anyone help me with this one?
Thanks