Workbook Name

dave8

Active Member
Joined
Jul 8, 2007
Messages
275
I have a program that is using two workbooks. Actually, the first workbook opens the second workbook. Therefore, for example, Workbook1 and Workbook2. So, if in Workbook1, how to set the name of the workbook to Workbook2, and vice versa?
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Hello,

I may have misunderstood and could be way off...


Do you mean how to differentiate between the two in VBA?

If so, and if I remember correctly:

Windows("Workbook1").Activate

Or

Workbooks("Workbook1").Sheets("Sheet1").Range("A1").Activate


Another way may be like:

msgbox Workbooks(1).Name
msgbox Workbooks(2).name

Does any of that help?

-Jeff
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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