Add a search button to pull text with in a spreadsheet like this forums search button

  • Thread starter Thread starter jiminy_crime
  • Start date Start date
J

jiminy_crime

I want to know how to add a search button to microsoft excel similar t
this forums that pull up specific text. This is for a big busines
project
 
This works for me when associated with a button.

Dim wks As Worksheet
Dim rng As Range
Dim strAddress As String, strFind As String

strFind = InputBox("Please enter search reference:")

For Each wks In Worksheets
Set rng = wks.Cells.Find(strFind, lookat:=xlWhole
LookIn:=xlFormulas)
If Not rng Is Nothing Then
strAddress = rng.Address
Do
Application.Goto rng, True
If MsgBox("Continue Searching?", vbYesNo + vbQuestion)
vbNo Then Exit Sub
Set rng = Cells.FindNext(after:=ActiveCell)
If rng.Address = strAddress Then Exit Do
Loop
End If
Next wk
 
Back
Top