I would like to enter a formula in cell D2 which sums up a dynamic range starting in column G2 and extending to the right. Is this the correct approach in line #9
[vba]Private Sub cmdNewEntry_Click()
Dim NewRow As Long, LastCol as Long
With Worksheets("Results")
NewRow = Cells(Rows.Count, "A").End(xlUp).Row + 1
LastCol = Cells(Columns.Count,"G").End(xlRight).Column
Cells(NewRow, 1).Formula = "=Row()-1"
Cells(NewRow, 2).Value = Me.txtCaptain.Value
Cells(NewRow, 3).Value = Me.txtPOB.Value
Cells(NewRow, 4).Formula = WorksheetFunction.Sum(Range(Range("$G2"), Range("$G2").End(xlRight)))
'Cells(NewRow, 5).Formula = Lookup header for each row in Fish_Table to allocate points.
Cells(NewRow, 6).Formula = "=IF($E2>0,RANK(Table2[[#This Row],[Points]],[Points],1),"")"
End With
End Sub[/vba]