Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Search multiple workbooks in file for data

Is there a way to search multiple workbooks in a file with user input for
search then copying the data to another worksheet? Thank you in advance for
any help.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200703/1

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Search multiple workbooks in file for data

Something like this should work:
Sub SearchWorkbook()
Dim ws As Worksheet
Dim r As Range
Dim sSV As String 'Search Value
sSV = InputBox("Please Enter Search Value", "Searching...")
For Each ws In ActiveWorkbook.Worksheets
Set r = Nothing
Set r = ws.Cells.Find(What:=sSV, _
After:=ws.Range("A1"), LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=True)
'Change LookAt:=xlWhole to xlPart if you want a partial match
If not r Is Nothing Then r.Copy 'Your Destination
Next
--
Charles Chickering

"A good example is twice the value of good advice."


"DJTI via OfficeKB.com" wrote:

Is there a way to search multiple workbooks in a file with user input for
search then copying the data to another worksheet? Thank you in advance for
any help.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200703/1


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Search multiple workbooks in file for data

Thank you Charles. I will take your advice and work with it.
Deb

Charles Chickering wrote:
Something like this should work:
Sub SearchWorkbook()
Dim ws As Worksheet
Dim r As Range
Dim sSV As String 'Search Value
sSV = InputBox("Please Enter Search Value", "Searching...")
For Each ws In ActiveWorkbook.Worksheets
Set r = Nothing
Set r = ws.Cells.Find(What:=sSV, _
After:=ws.Range("A1"), LookIn:=xlFormulas, _
LookAt:=xlWhole, SearchOrder:=xlByRows, _
SearchDirection:=xlNext, MatchCase:=True)
'Change LookAt:=xlWhole to xlPart if you want a partial match
If not r Is Nothing Then r.Copy 'Your Destination
Next
Is there a way to search multiple workbooks in a file with user input for
search then copying the data to another worksheet? Thank you in advance for
any help.


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200703/1

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
Search multiple workbooks upsidedown_pw[_2_] Excel Worksheet Functions 3 August 30th 09 12:16 AM
Search across multiple workbooks Ed K Excel Discussion (Misc queries) 2 August 2nd 09 01:30 PM
multiple workbooks in one file Irene Excel Discussion (Misc queries) 3 March 27th 09 10:03 PM
Search & extract from multiple workbooks Ann Excel Programming 6 November 15th 05 08:34 PM
text search between workbooks, copy data G8834 Excel Programming 1 June 24th 04 08:07 PM


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