Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i am looking to enter a search term, look in the entire workbook for the
term, then return the sheet name and row number of all found instances. wild card searches would be a bonus if possible. tried a few things but nothing works quite right. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Did you try going to File=Open, then in the upper right of the dialog,
select tools and then Search? -- Regards, Tom Ogilvy "inov8r" wrote: i am looking to enter a search term, look in the entire workbook for the term, then return the sheet name and row number of all found instances. wild card searches would be a bonus if possible. tried a few things but nothing works quite right. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Search the VBA help for the Find Method to see an example. Here's one way doing it. It will search for "Hello" in the workbook and concatenate the addresses in a string variable. Sub FindHello() Dim sht As Worksheet Dim c As Range Dim strFindResults Dim firstAddress As String For Each sht In ActiveWorkbook.Worksheets With sht.UsedRange Set c = .Find("Hello", LookIn:=xlValues) If Not c Is Nothing Then firstAddress = c.Address Do strFindResults = strFindResults & "'" & c.Parent.Name & "'!" & c.Address & vbNewLine Set c = .FindNext(c) Loop While Not c Is Nothing And c.Address < firstAddress End If End With Next sht MsgBox strFindResults End Sub -- Hope that helps. Vergel Adriano "inov8r" wrote: i am looking to enter a search term, look in the entire workbook for the term, then return the sheet name and row number of all found instances. wild card searches would be a bonus if possible. tried a few things but nothing works quite right. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Never mind, I misread you posting.
-- Regards, Tom Ogilvy "Tom Ogilvy" wrote: Did you try going to File=Open, then in the upper right of the dialog, select tools and then Search? -- Regards, Tom Ogilvy "inov8r" wrote: i am looking to enter a search term, look in the entire workbook for the term, then return the sheet name and row number of all found instances. wild card searches would be a bonus if possible. tried a few things but nothing works quite right. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
file search or search files | Excel Discussion (Misc queries) | |||
Search a FAQ file | Excel Worksheet Functions | |||
Turning a text file name into a search and linking the file as a hyperlink | Excel Discussion (Misc queries) | |||
File Search | Excel Programming | |||
Macro to search from one file & place on another file. | Excel Programming |