Private Sub CommandButton1_Click()
Dim c As Variant
Dim pt As Variant
CloseDate = Format(DateValue(EndDateTextBox.Value), "d/mmm/yyyy")
RefNo = cbListWorkOrderNumbers.Value ' From TextBox
With Workbooks("BB Closure prep.xls").Worksheets("Schedules").Columns("B:B")
Set c = .Find(RefNo, LookIn:=xlValues, after:=Range("B3"), SearchDirection:=xlPrevious)
If Not c Is Nothing Then
c.Offset(0, -1).Value = NoticeType
c.Offset(0, 2).Value = JobCodeComboBox.Value
c.Offset(0, 4).HorizontalAlignment = xlLeft
c.Offset(0, 4).Value = CloseDate
c.Offset(0, 14).Value = AreaCodeComboBox.Value
Else
pt = MsgBox("NO SUCH REF No EXISTS", vbCritical, "ERROR")
End If
End With
End Sub