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

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
 
D

djssuk

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top