Hi..
Sorry for the late reply..
Private Sub CommandButton1_Click()
Dim str As String, sh1 As Worksheet, c, x As Long
Set sh1 = Sheets("Sheet1")
With sh1.Range("G:G", "J:J")
str = "*" & Cells(2, 2).Value & "*"
Set c = .Find(str, LookIn:=xlValues)
sh1.Cells(2, 3).Value = Application.CountIf(sh1.Range("G:G", "J:J"), str)
x = sh1.Cells(2, 3).Value
If Not c Is Nothing Then
firstaddress = c.Address
Do
Application.Goto c
Msgtext = MsgBox("Found: " & sh1.Cells(2, 3).Value & " Matches" & vbNewLine & vbNewLine & _
"Remaining: " & x & vbNewLine & vbNewLine & "Goto Next?", vbYesNo, "Itterate Through Found Values")
If Msgtext = vbNo Then
Exit Sub
Else
GoTo 1
End If
1
x = x - 1
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstaddress
End If
End With
End Sub
Bookmarks