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

Hey, I have a workbook with many worksheets. I am trying to write a
macro to search all the worksheets for a unique value. I have a
userform to enter the value and assign it to a variable. I just need
to search all sheet for that string, and if that string exists in a
worksheet, activate that worksheet. Anyone done anything like this?
Can you help?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Search all worksheets

This should be close...

Sub FindStuff()
Dim wks As Worksheet
Dim rngFound As Range

For Each wks In Worksheets
Set rngFound = wks.Cells.Find(What:="asdf", _
LookAt:=xlPart, _
LookIn:=xlFormulas, _
MatchCase:=False)
If Not rngFound Is Nothing Then
wks.Select
rngFound.Select
Exit For
End If
Next wks
End Sub
--
HTH...

Jim Thomlinson


" wrote:

Hey, I have a workbook with many worksheets. I am trying to write a
macro to search all the worksheets for a unique value. I have a
userform to enter the value and assign it to a variable. I just need
to search all sheet for that string, and if that string exists in a
worksheet, activate that worksheet. Anyone done anything like this?
Can you help?


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
Search Multiple Worksheets Bob[_16_] Excel Discussion (Misc queries) 3 March 21st 10 08:18 PM
Search all worksheets [email protected] Excel Programming 1 September 12th 07 10:43 PM
search worksheets Anthony Excel Discussion (Misc queries) 11 July 14th 05 03:24 PM
Search all worksheets in a workbook... Peter Excel Discussion (Misc queries) 6 January 26th 05 11:07 AM
Search Mutiple WorkSheets Ben Jimenez Excel Programming 5 July 29th 03 09:48 PM


All times are GMT +1. The time now is 10:30 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"