Hi All
I'm having trouble getting this to work.
The first part of the code works fine but I cant get the match to work.
What I am trying to do is find the match in column A of sheet Plan Data which corresponds to the contents of textbox 10 in the userform.
What I then intend to do is in the row where the match is found in column B enter Cancelled, but I cant get the match to work. I've only ever used match once before and didn't have a lot of luck that time either. The msgbox is only there to help me.
Any ideas out there where I'm going wrong please
cheers
Paul
I'm having trouble getting this to work.

The first part of the code works fine but I cant get the match to work.
What I am trying to do is find the match in column A of sheet Plan Data which corresponds to the contents of textbox 10 in the userform.
What I then intend to do is in the row where the match is found in column B enter Cancelled, but I cant get the match to work. I've only ever used match once before and didn't have a lot of luck that time either. The msgbox is only there to help me.
Any ideas out there where I'm going wrong please
cheers
Paul
Code:
Private Sub UserForm_Initialize()
Me.TextBox10.Text = CStr(ThisWorkbook.Sheets("plan status").range(ActiveCell.Address).Value)
End Sub
Private Sub TextBox11_BeforeUpdate(ByVal cancel As MSForms.ReturnBoolean)
On Error Resume Next
Me.TextBox11 = Format(TextBox11, "dd/mm/yyyy")
End Sub
Private Sub CommandButton10_Click()
Sheets("plan status").Unprotect Password:="password1"
Sheets("plan status").range("F" & ActiveCell.Row) = TextBox11.Value
Sheets("plan status").range("C" & ActiveCell.Row) = "Cancelled"
Sheets("plan status").range("D" & ActiveCell.Row) = "Cancelled"
Sheets("plan status").range("E" & ActiveCell.Row) = "Cancelled"
Sheets("plan status").Protect Password:="password1"
Findmatch
End Sub
Sub Findmatch()
Dim rng1 As range
Dim myFind
myFind = TextBox10.Value
Dim myrow As range
With Sheets("Plan Data").range("A4:A500")
myrow = .Find(What:=myFind, After:=ActiveCell, LookIn:=xlValue, Lookat:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)Activecell.Row
MsgBox myrow & " row number"
End With
Unload UserForm3
End Sub