I want to find the location of the a word in an Excel document.

G

Gord Dibben

CTRL + F

Options>Within>Workbook

Enter your word and OK

VBA method...................

Sub Find_Test_All_Worksheets()
Dim FindString As String
Dim rng As Range
Dim Sh As Worksheet

FindString = InputBox("Enter a word or string")

For Each Sh In ThisWorkbook.Worksheets
With Sh.Range("A:AA") 'adjust to suit
Set rng = .Find(what:=FindString, _
After:=.Cells(.Cells.Count), _
LookIn:=xlValues, _
lookat:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
MsgBox "found at " & Sh.Name & rng.Address
Else
MsgBox "Nothing found in sheet: " & Sh.Name
End If
End With
Next Sh
End Sub


Gord Dibben MS Excel MVP
 

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