Hi,
I feel a bit sheepish, - there is nothing wrong with the code I had, ... the problem was that I had a Dim statement elsewhere, that I had not commented out when I was trying to get it to work.
If it is of any help to anyone else, here is the code
' Check if input is FOREMAN in Sign Off and get Rate for the Milestone signed off
Dim Rate As Double
If ComboBox8.Text = "FOREMAN" Then
Rate = Application.WorksheetFunction.VLookup(Me.ComboBox6.Value, Worksheets("Lists").Range("J3:K22"), 2, False)
Else
Rate = 0
End If
' And to Save to a Table :-
' Determine the next empty row
NextRow = _
Application.WorksheetFunction.CountA(Range("A:A")) + 1
' Transfer the data
Cells(NextRow, 1) = 0 ' Material Description
Cells(NextRow, 2) = 0 ' Material Quantity Issued
Cells(NextRow, 3) = 0 ' Material Quantity Received
Cells(NextRow, 4) = 0 ' Task Description
Cells(NextRow, 5) = ComboBox6.Text ' Milestone
Cells(NextRow, 6) = 0 ' House ID
Cells(NextRow, 7) = ComboBox2.Text ' House Number
Cells(NextRow, 8) = ComboBox9.Text ' Subbie Name
Cells(NextRow, 9) = TextBox1.Text ' Date of sign off
Cells(NextRow, 10) = Todaysdate 'date captured
Selection.NumberFormat = "dd/mm/yyyy"
Cells(NextRow, 11) = ComboBox8.Text ' Signed Off By
Cells(NextRow, 12) = "Sign Offs" ' Status Identifier
Cells(NextRow, 13) = Rate ' Rate
Cells(NextRow, 14) = TextBox2.Text ' DOH Number