Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

Search Multiple Workbooks - VBA Macros

0

Dears

Atteched file is very good file for searching data. So is there ability to use it while the source file that contain whole data is open.

Cause is tested its opened the source file to got searching data then close it

Thanks for your support

Answer
Discuss

Discussion

Yes there is, how you do it depends on the specifics of your situation. I'd suggest that you add some code around the Workbooks.Open line of code that checks if the workbook is already open (a simple loop through the open workbooks) and, if it's open, assign it to the workbook variable that you use for the search and, if it's not open, allow the original chunk of code to run around the Workbooks.Open line of code.
don (rep: 1989) May 31, '22 at 3:26 pm
Yes, that;s my point "add some code around the Workbooks.Open line of code that checks if the workbook is already open (a simple loop through the open workbooks) and, if it's open, assign it to the workbook variable that you use for the search and, if it's not open, allow the original chunk of code to run around the Workbooks.Open line of code" could you please support me for this code in attchec file.
Luka_Rashed (rep: 2) May 31, '22 at 4:01 pm
Add to Discussion

Answers

0

Hi Luka and welcome to the Forum

I sse that you have the files from Don's tutorial Fast Search Multiple Workbooks - VBA Macro but I'm struggling to understand your question.

If you look in the site's Excel Tutorials section (link in green bar above), the next tutorial is Fast Search Multiple Workbooks in Excel with a File Picker - VBA Macros which will let you select the files to be searched (then open/close them for you).

Hope this helps. If not, please edit your original question to explain what you want (e.g. saying how many files you want to open).

Discuss


Answer the Question

You must create an account to use the forum. Create an Account or Login