A
Alen32
I got thics code here but I can't insert results in listbox.
With userform1
if .optionButton1 then
sOne = "Horse"
else
sOne = "Pig"
end if
if .optionButton3 then
sTwo = "Danish"
else
sTwo = "Foreign"
end if
sThree = .Textbox1.Text
End With
With Worksheets(1).Cells
Set c = .Find(sOne, lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
if application.countif(c.EntireRow,"*" & sTwo & "*") and _
application.Countif(c.EntireRow,"*" & sThree & "*") then
' add row to listbox
end if
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With
With userform1
if .optionButton1 then
sOne = "Horse"
else
sOne = "Pig"
end if
if .optionButton3 then
sTwo = "Danish"
else
sTwo = "Foreign"
end if
sThree = .Textbox1.Text
End With
With Worksheets(1).Cells
Set c = .Find(sOne, lookin:=xlValues)
If Not c Is Nothing Then
firstAddress = c.Address
Do
if application.countif(c.EntireRow,"*" & sTwo & "*") and _
application.Countif(c.EntireRow,"*" & sThree & "*") then
' add row to listbox
end if
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstAddress
End If
End With