Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 64
Default Search Macro or VB script

anyone know of a search macro or VB script that can perform searches for cell
entrys such as SKUs along multiple Excel spreadsheets? I need a fast way to
search for specific entrys in hundreds of spreadsheets.

Thanks Evan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Search Macro or VB script

If you only require the filename in which the search word is in; then why
dont you try Windows search?

--From windows explorer right click the parent folder.Search
--From the search window 'All or part of filename' mention *.xl*
--In the secong text box 'A word or phrase in the file' enter your search
keyword and hit 'Search'

"Evan" wrote:

anyone know of a search macro or VB script that can perform searches for cell
entrys such as SKUs along multiple Excel spreadsheets? I need a fast way to
search for specific entrys in hundreds of spreadsheets.

Thanks Evan

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default Search Macro or VB script

Hi Evan

Try the below in a new workbook.

Sub Macro()
Dim strFile As String, wb As Workbook, ws As Worksheet
Dim strSearch As String, varFound As Variant
Dim intCount As Integer, wsMain As Worksheet

strSearch = InputBox("Enter Search string")
strfolder = "D:\"

Set wsMain = ActiveSheet
strFile = Dir(strfolder & "*.xl*", vbNormal)
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Do While strFile < ""
Set wb = Workbooks.Open(strfolder & strFile, ReadOnly:=True)
For Each ws In wb.Worksheets
Set varFound = ws.Cells.Find(strSearch, _
LookIn:=xlValues, LookAt:=xlPart)
If Not varFound Is Nothing Then
intCount = intCount + 1
wsMain.Range("A" & intCount) = strFile
wsMain.Range("B" & intCount) = ws.Name
wsMain.Range("C" & intCount) = varFound.Address
wsMain.Range("D" & intCount) = varFound.Text
End If
Next
wb.Close False
Set wb = Nothing
strFile = Dir
Loop
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub

"Evan" wrote:

anyone know of a search macro or VB script that can perform searches for cell
entrys such as SKUs along multiple Excel spreadsheets? I need a fast way to
search for specific entrys in hundreds of spreadsheets.

Thanks Evan

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
Excel 2003 VBA Help me complete this Search script RompStar Excel Programming 2 December 14th 07 05:24 PM
VBA Script to search for a specific cell - Help needed Zeke XA3 Excel Programming 1 July 5th 06 08:07 PM
In search of VBA script ab500 Excel Programming 0 June 22nd 05 04:02 AM
Use Windows Script to run Windows Explorer Search? Ian Elliott[_3_] Excel Programming 0 January 12th 04 05:03 PM


All times are GMT +1. The time now is 05:38 AM.

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"