I'm trying to insert a formula and copy it down to the last row of the data it's working on.
When I execute this code, I get the error "Run-time error '1004': Method 'Range' of object '_Global' failed.
Is there something wrong with my syntax here, or something else I'm missing?
Thanks in advance for your help!
Code:
Sub InsertAndCopyFormula()
Sheets("PasteData").Select
Range("L2:L" & LastRow).Formula = "=MONTH(I2)"
End Sub
When I execute this code, I get the error "Run-time error '1004': Method 'Range' of object '_Global' failed.
Is there something wrong with my syntax here, or something else I'm missing?
Thanks in advance for your help!