How do you copy data from another open workbook using VBA?

9tanstaafl9

Well-known Member
Joined
Mar 23, 2008
Messages
534
Hello all!



I want to copy data from an unknown tab on an unknown workbook into my workbook that will contain the macro that makes this happen. Is there a way to ask the user to click somewhere on the appropriate tab on the appropriate workbook and then capture that address to use elsewhere in my macro?



I hope this is an easy question. I'm self taught and there are some serious gaps in my VBA knowledge. That VBA for Dummies book didn't cover everything. ?
 

Some videos you may like

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

9tanstaafl9

Well-known Member
Joined
Mar 23, 2008
Messages
534
So for example, data is in workbook A and the macro is in workbook B. Both are open. They press a button on wb B and maybe get asked to click on the tab in wb A that has their data. Can I use a click to get wb A's name? Or is there another way?
 

9tanstaafl9

Well-known Member
Joined
Mar 23, 2008
Messages
534
I realize my title isn't really asking the right question. I know how to copy and paste but not how to get the file name of the other open workbook. I need to repost my question. Sorry for misleading anyone.
 

Watch MrExcel Video

Forum statistics

Threads
1,099,681
Messages
5,470,101
Members
406,681
Latest member
sachinmasurkar

This Week's Hot Topics

Top