Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Entire Workbook Search

Is there any way to perform a "global" search or "lookup" of a given piece
of data in an entire workbook composed of several worksheets?? Any advise
will be greatly appreciated.

Art


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Entire Workbook Search

Sub FindInWorkbook()
Dim rng as Range, sh as Worksheet
Dim vTarget as Variant, fAddr as String
vTarget = "dog"
For each sh in ActiveWorkbook.Worksheets
With sh.Cells
Set rng = .Find(vTarget, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByRows, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not rng Is Nothing Then
fAddr = rng.Address
Do
msgbox rng.Address(0,0,xlA1,external:=True)
Set rng = .FindNext(rng)
Loop While rng.Address < fAddr
End If
End With
Next sh
End Sub

--
Regards,
Tom Ogilvy


"ArtLab" wrote in message
...
Is there any way to perform a "global" search or "lookup" of a given piece
of data in an entire workbook composed of several worksheets?? Any advise
will be greatly appreciated.

Art



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
save search settings having all tabs selected-or entire workbook Kens Excel Worksheet Functions 0 February 28th 07 09:36 PM
VLookup function to search an entire workbook liseladele Excel Worksheet Functions 0 November 10th 05 12:35 AM
Search Entire Workbook Sloth Excel Discussion (Misc queries) 1 October 14th 05 08:56 AM
Search Entire Workbook Sloth Excel Discussion (Misc queries) 0 October 14th 05 05:12 AM
How to Search for word in the Entire Workbook lbbss Excel Discussion (Misc queries) 4 July 4th 05 08:57 PM


All times are GMT +1. The time now is 03:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"