Hello
I am trying to run a macro that Autofills a formula in Sheet18 from Sheet 10, but I keep getting an error "Autofill Mehod of Range class failed".
<code>
'Demarcate autofill in accordance with last row of values in Column C</code><code>
With Sheet18
'Insert function to check for S and A at beginning of Column F values
Application.EnableEvents = False</code><code>
<code></code><code>
End With
</code>
I get the error on the red line, can someone please help me to rectify the code?
I am trying to run a macro that Autofills a formula in Sheet18 from Sheet 10, but I keep getting an error "Autofill Mehod of Range class failed".
<code>
'Demarcate autofill in accordance with last row of values in Column C</code><code>
lastRow1 = Sheet18.Range("C" & Rows.Count).End(xlUp).row
</code><code>
</code><code>With Sheet18
'Insert function to check for S and A at beginning of Column F values
Application.EnableEvents = False</code><code>
.Range("U2").Formula = "=IF(LEFT(H2,1) = ""S"",0.8,IF(LEFT(H2,1)=""A"",0.5,""PROBLEEM""))"
</code>
<code></code><code>
.Range("U2").AutoFill Destination:=Range("U2:U" & lastRow1), Type:=xlFillDefault
Application.EnableEvents = True
End With
</code>
I get the error on the red line, can someone please help me to rectify the code?