4,375 questions
How do I resolve vba error 1004 when trying to autofill using a variable for dynamic range?
Alley, Ann
0
Reputation points
I get error 1004 on this line of Excel vba code and don't know how to resolve.
Selection.AutoFill Destination:=Range("R2:R" & lastRow)
Dim wb As Workbook
Dim ws As Worksheet
Set wb = ActiveWorkbook
Set ws = Sheets("Milestones")
wb.Activate
ws.Select
Dim lastRow As Long
lastRow = ws.Range("A" & ws.Rows.Count).End(xlUp).Row
Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Excel | For business | Windows
3,888 questions
Sign in to answer