ActiveCell.FormulaR1C1 = "=IF(LEFT(C[-3])>0,C[-3]*6,C[-3])"
Range("L10").Select
Selection.AutoFill Destination:=Range("L10:L32"), Type:=xlFillDefault
Range("L10:L32").Select
I need the last line with data. L32 will not always be the last line.
ActiveCell.FormulaR1C1 = "=IF(LEFT(C[-3])>0,C[-3]*6,C[-3])"
Range("L10").Select
Selection.AutoFill Destination:=Range("L10:L32"), Type:=xlFillDefault
Range("L10:L32").Select
I need the last line with data. L32 will not always be the last line.
This will find the last used row in column A and fill the formula to that row starting in L10
With ActiveSheet
Dim lstrw As Long
lstrw = .Cells(.Rows.Count, 1).End(xlUp).Row
.Range(.Cells(10, "L"), .Cells(.lstrw, "L")).FormulaR1C1 = "=IF(LEFT(C[-3])>0,C[-3]*6,C[-3])"
End With