[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Bundychik

12/12/2006 10:16:00 PM

I am a beginner to visual basic and need to write a macro to swap between two
workbooks without mentioning any filenames. Can anyone help?

4 Answers

bony_tony

12/12/2006 11:34:00 PM

0

This macro will take to the next workbook;

Sub Switch_workbooks()
'
' Switch_workbooks Macro
' Macro recorded 13/12/2006 by Tony Gardner
'
ActiveWindow.ActivateNext
End Sub

If you press Ctrl-Tab whilst recording a macro, it will write this
exact code for you

Tony



Bundychik wrote:
> I am a beginner to visual basic and need to write a macro to swap between two
> workbooks without mentioning any filenames. Can anyone help?

Bundychik

12/13/2006 11:41:00 AM

0

Bundychik wrote:
Thanks for the tip...will try that when I get to work in the morning :)

--
Message posted via http://www.of...

Bundychik

12/16/2006 11:49:00 PM

0

Hey bony_tony

Excellent tip...worked a treat and I got my macro finished before I started
holidays! Thanks for the help!
Cheers
Bundychik



bony_tony wrote:
>This macro will take to the next workbook;
>
>Sub Switch_workbooks()
>'
>' Switch_workbooks Macro
>' Macro recorded 13/12/2006 by Tony Gardner
>'
> ActiveWindow.ActivateNext
>End Sub
>
>If you press Ctrl-Tab whilst recording a macro, it will write this
>exact code for you
>
>Tony
>
>> I am a beginner to visual basic and need to write a macro to swap between two
>> workbooks without mentioning any filenames. Can anyone help?

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/excel-programmin...

bony_tony

12/19/2006 5:52:00 AM

0

no problemo bundy

Bundychik via OfficeKB.com wrote:
> Hey bony_tony
>
> Excellent tip...worked a treat and I got my macro finished before I started
> holidays! Thanks for the help!
> Cheers
> Bundychik
>
>
>
> bony_tony wrote:
> >This macro will take to the next workbook;
> >
> >Sub Switch_workbooks()
> >'
> >' Switch_workbooks Macro
> >' Macro recorded 13/12/2006 by Tony Gardner
> >'
> > ActiveWindow.ActivateNext
> >End Sub
> >
> >If you press Ctrl-Tab whilst recording a macro, it will write this
> >exact code for you
> >
> >Tony
> >
> >> I am a beginner to visual basic and need to write a macro to swap between two
> >> workbooks without mentioning any filenames. Can anyone help?
>
> --
> Message posted via OfficeKB.com
> http://www.officekb.com/Uwe/Forums.aspx/excel-programmin...