View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Excel MVP Don Guillett Excel MVP is offline
external usenet poster
 
Posts: 168
Default Searching a group of Excel workbooks..... (ADO)

On Sep 24, 3:33*am, "Robert Crandal" wrote:
That file contains soooo many functions and it is filled with lots of
arcane code that I don't know where to begin, haha! * 8(

What is the simple way to open a group of files with this ADO?
How do I make a query into an open file? *And finally, how do
I close the file(s) when done with my inquiry?

Thank you!

"GS" wrote in message

...



Robert Crandal has brought this to us :


You can use ADO to search data stored in workbooks without opening them
for each search. Here's some example code by Rob Bovey that demonstrates
how this is done.


*http://www.appspro.com/conference/Da...ogramming.zip- Hide quoted text -


- Show quoted text -


Here is an idea you may like to try. make an array or list and loop
thru to change a formula until found....

Sub vlookupinworkbooks()
what = "text to look for"
For Each wb In Array("filename1", "filename2", "filename3")
Range("o3").Formula = "=VLOOKUP(""" & what & """," & _
"'C:\yourfoldername\[" & wb & ".xls]yoursheetname'!$B$7:$Z$1000,2,0)"
If Not Application.IsNA(Range("o3")) Then Exit Sub
MsgBox wb
Next wb
End Sub