Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
hi, i got the code below where i want to add the data from A38 - K38 but i keep getting error 'Run-time error 91 - object variable or with block variable not set' please can you help me with this?
Code:
Private Sub OKButton_Click()
Dim emptyRow As Long
With ThisWorkbook.Sheets("Northants")
emptyRow = .Range("A37:K37").Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row + 1
'Transfer Information
.Cells(emptyRow, 1).Value = DateBox.Value
.Cells(emptyRow, 2).Value = TimeBox.Value
.Cells(emptyRow, 3).Value = MPANBox.Value
.Cells(emptyRow, 4).Value = JobBox.Value
.Cells(emptyRow, 5).Value = MTBox.Value
.Cells(emptyRow, 6).Value = CustomerBox.Value
.Cells(emptyRow, 7).Value = ContactBox.Value
.Cells(emptyRow, 8).Value = AddressBox.Value
.Cells(emptyRow, 9).Value = PostCodeBox.Value
.Cells(emptyRow, 10).Value = NotesBox.Value
.Cells(emptyRow, 11).Value = CARRBox.Value
End With
End Sub