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

9tanstaafl9

Well-known Member
Joined
Mar 23, 2008
Messages
535
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. ?
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
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?
 
Upvote 0
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.
 
Upvote 0

Forum statistics

Threads
1,215,039
Messages
6,122,799
Members
449,095
Latest member
m_smith_solihull

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top