Hello

You'll have to bear with me as not great at VBA. I want a formula to dynamically autofill in column G based on the contents of column F.

I'm trying to use the following but it's not working.


Sub CalcLengths()

    Dim lastrow As Long

    Range("G2").Select
    ActiveCell.FormulaR1C1 = "=RC[-5]*1"
    Selection.NumberFormat = "h:mm"
    
    lastrow = Cells(Rows.Count, "F").End(xlUp).Row + 1
    Selection.AutoFill Destination:=Range("G2" & lastrow), Type:=xlFillDefault

End Sub
Can anyone help please?