Active workbook

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

HI gan
I used recorder to record macro. I Switch from the active WB to another WB and then want to switch back. How do I make this generic to go back to previous workbook. The recorder is specific to the files that I had open at the time

Windows("Book3").Activat
My Cod
Windows("040403.xls").Activat

Book3 is a good reference but I need the 040403 reference to be (Back to previous Window

Thank
 
Windows("Book3").Activate
Set origWB = ActiveWorkbook
My Code
Windows("040403.xls").Activate

origWB.Acrtiate

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Jimmy said:
HI gang
I used recorder to record macro. I Switch from the active WB to another
WB and then want to switch back. How do I make this generic to go back to
previous workbook. The recorder is specific to the files that I had open at
the time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top