caoliz
04-24-2017, 07:28 AM
Hello,
I am trying to write a code that will autofill formulas in columns H, I, and J to the end of the data set (there is data in columns A-G). I have the below so far:
Sub Autofill()
'
' Autofill Macro
'
Sheets("Claims Filed Data").Select
Range("H4:H" & Lastrow).Formula = "=(NETWORKDAYS(F4,E4))-1"
Range("I4:I" & Lastrow).Formula = "=IF(H4<=2,"Yes", "No")"
Range("K4:K" & Lastrow).Formula = "=E4+(6-WEEKDAY(E4))"
End Sub
I get the run-time error '1004' - Method 'Range' of object'_Global' failed with the above code. Will someone please help?
Thank you!
I am trying to write a code that will autofill formulas in columns H, I, and J to the end of the data set (there is data in columns A-G). I have the below so far:
Sub Autofill()
'
' Autofill Macro
'
Sheets("Claims Filed Data").Select
Range("H4:H" & Lastrow).Formula = "=(NETWORKDAYS(F4,E4))-1"
Range("I4:I" & Lastrow).Formula = "=IF(H4<=2,"Yes", "No")"
Range("K4:K" & Lastrow).Formula = "=E4+(6-WEEKDAY(E4))"
End Sub
I get the run-time error '1004' - Method 'Range' of object'_Global' failed with the above code. Will someone please help?
Thank you!