Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default search xl file w/vba

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default search xl file w/vba

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default search xl file w/vba

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default search xl file w/vba

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
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
file search or search files Richad Excel Discussion (Misc queries) 0 October 22nd 09 07:56 PM
Search a FAQ file Jane Excel Worksheet Functions 1 October 18th 06 09:07 PM
Turning a text file name into a search and linking the file as a hyperlink AlistairM Excel Discussion (Misc queries) 1 January 26th 06 04:55 AM
File Search unplugs[_48_] Excel Programming 1 August 8th 04 02:12 PM
Macro to search from one file & place on another file. Luong[_2_] Excel Programming 0 May 6th 04 04:53 PM


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