ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Search in Multiple Sheets (https://www.excelbanter.com/excel-discussion-misc-queries/158033-search-multiple-sheets.html)

[email protected]

Search in Multiple Sheets
 
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?


JB

Search in Multiple Sheets
 

Sub chercheFindMultiFeuillesValeur()
x = "ABCD"
For Each s In ActiveWorkbook.Sheets
With Sheets(s.Name).Cells
Set c = .Find(x, LookIn:=xlValues)
If Not c Is Nothing Then
premier = c.Address
Do
c.Interior.ColorIndex = 4
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address < premier
End If
End With
Next s
End Sub

http://boisgontierjacques.free.fr/fi...iFeuilles2.xls

JB
http://boisgontierjacques.free.fr/

On 12 sep, 22:28, 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?




Jim Rech

Search in Multiple Sheets
 
Just FYI, if you have Excel 2002 or later the built-in Find feature can be
set to search the entire workbook.

--
Jim
wrote in message
ups.com...
| 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?
|



Jim Thomlinson

Search in Multiple Sheets
 
See the answer posted in programming. Please do not mulit post. Check out
this link...

http://www.cpearson.com/excel/newposte.htm
--
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?



Dave Peterson

Search in Multiple Sheets
 
xl2002 offers a find in workbook (under the Options button on the Edit|Find
dialog).

Then you can click on the line in the results window to go to that location.

I had to search for that site:

http://www.theupdown.com/

where you can "play" with investments.

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?


--

Dave Peterson


All times are GMT +1. The time now is 12:48 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com