Tweaking existing VBA code...

Von Pookie

MrExcel MVP
Joined
Feb 17, 2002
Messages
13,686
...however, I don't know how to write VBA code. What I'm using, I got help with from here. :biggrin:

(I had all of this typed already, but apparently my login expired...grr...anyway...)

The code I'm currently using opens 2 separate workbooks and prompts for the others to open.

I usually start entering information in a certain workbook every time. How can I set it to switch to this one workbook after it opens the one I select?

Thanks!
 
Hi Christy


I suspected as much! I think you will find that there is no Workbook open by the name of
"Main Directory.xls" or you have miss-spelt the name?





Workbooks("Main Directory.xls").Activate
 
Upvote 0

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Nope, the name's spelled correctly...but that is one of the files that it should open on its own first.

It automatically opens that file and one other, then prompts for the third. I just want it to switch back to that one after it opens the one the user selects to open, and before it closes the workbook with the macro. As it is, it will stay on the last book opened. I use the main directory.xls first.

It's no big deal if I can't get this to work, I was just trying to simplify it a little further.

Thanks again,
 
Upvote 0
Woohoo! I managed to get it to work! :biggrin:

Trial and error is a pain in the butt!

Thanks,
_________________
Kristy

"There are two means of refuge from the miseries of life: music and cats." - Albert Schweitzer
This message was edited by Von Pookie on 2002-04-04 13:25
 
Upvote 0

Forum statistics

Threads
1,215,004
Messages
6,122,656
Members
449,091
Latest member
peppernaut

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