Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,696 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
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