Excuse me, I'm having a problem with this vba
I'm new in vba for excel and I want to make a program which I can input data using userform and then search the data by using other form (I make 4 different userform). All the data is in one sheet, and the search criteria that I want to find is in column B.
My problem is I can't make find code yet.
I try to copy some code (just in search code) from excel-it.com database but I'm having trouble since it said that "object variabel or with block variable not set"

Would you please tell me what is wrong with my code

Dim Ws As Worksheet
Dim MyData As Range
Dim c As Range
Dim rFound As Range
Dim r As Long
Dim rng As Range
Dim oCtrl As MSForms.Control

Private Sub cmbFind_Click()
Dim strFind As String 'what to find
Dim FirstAddress As String
Dim f As Integer

strFind = Me.TextBox1.Value 'what to look for

With MyData
.AutoFilter
Set c = .Find(strFind, LookIn:=xlValues)
If Not c Is Nothing Then 'found it

With Me 'load entry to form
.TextBox2.Value = c.Offset(0, 1).Value
.TextBox3.Value = c.Offset(0, 2).Value
.TextBox4.Value = c.Offset(0, 3).Value
r = c.Row
f = 0
End With
FirstAddress = c.Address
Do
f = f + 1 'count number of matching records
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> FirstAddress
If f > 1 Then
Select Case MsgBox("There are " & f & " instances of " & strFind, vbOKCancel Or vbExclamation Or vbDefaultButton1, "Multiple entries")

Case vbOK
FindAll
Case vbCancel
'do nothing
End Select

End If
Else: MsgBox strFind & " not listed" 'search failed
End If
End With

End Sub

Sub FindAll()
Dim wesTemp As Worksheet
Dim strFind As String 'what to find

strFind = Me.TextBox1.Value

If Not Ws.AutoFilterMode Then MyData.AutoFilter

MyData.AutoFilter Field:=1, Criteria1:=strFind

Me.ListBox1.Clear
For Each c In MyData.Columns(1).SpecialCells(xlCellTypeVisible)
With ListBox1
.AddItem c.Value
.List(.ListCount - 1, 1) = c.Offset(0, 1).Value
.List(.ListCount - 1, 2) = c.Offset(0, 2).Value
.List(.ListCount - 1, 3) = c.Offset(0, 3).Value
.List(.ListCount - 1, 4) = c.Offset(0, 4).Value
.List(.ListCount - 1, 5) = c.Row
End With
Next c

End Sub


Thanks before