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

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
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,223,162
Messages
6,170,432
Members
452,326
Latest member
johnshaji

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