Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search Multiple Worksheets | Excel Discussion (Misc queries) | |||
Search all worksheets | Excel Programming | |||
search worksheets | Excel Discussion (Misc queries) | |||
Search all worksheets in a workbook... | Excel Discussion (Misc queries) | |||
Search Mutiple WorkSheets | Excel Programming |