Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: John Cooper   on Oct 19 In MS Office Category.

  
Question Answered By: Aadi Martin   on Oct 19

Maybe this could help. This would only look for the last instance of the
string you are looking for amongst the sheets. You can easily modify to
run thru all instances of search string to get the range required.

Option Explicit

Sub FindName()
Dim found  As Range
Dim ws As Worksheet, LookFor As String
LookFor = InputBox("Enter name to find")
If LookFor = "" Then Exit Sub
For Each ws In ActiveWorkbook.Worksheets
Set Found = Cells.Find(what:=LookFor, LookIn:=xlValues)
If Found Is Nothing Then Exit For
Next ws

If Found Is Nothing Then
MsgBox LookFor & " not found.", vbExclamation
Else
Found.Activate
End If

End Sub

Share: 

 

This Question has 4 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on inputbox macro help Or get search suggestion and latest updates.


Tagged: