Hi guys,
Looking for a macro that if on suday my workbook is active that my workbook closes and saving my workbook and that a other workbook is opening at 13:00.
Regards,
Hi guys,
Looking for a macro that if on suday my workbook is active that my workbook closes and saving my workbook and that a other workbook is opening at 13:00.
Regards,
Last edited by black7; 08-20-2013 at 12:37 PM.
Put this in the workbook or a worksheet module:Place this in its own stand alone module:Please Login or Register to view this content.
Untested.Please Login or Register to view this content.
Thanks,
Solus
Please remember the following:
1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.Highlight the code in your post and press the # button in the toolbar.2. Show appreciation to those who have helped you by clicking below their posts.
3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.
"Slow is smooth, smooth is fast."
The Code works almost. Lets give you more info because i think i set the code wrong because i am new to Macro scripting .
My workbook names are TeamA and TeamB and the files are by me on s:\Teams\
If i execute the macro SwitchWB the new workbook opens nice but the old workbook stays also active in the background ?
Please Login or Register to view this content.
Last edited by black7; 08-20-2013 at 01:34 PM.
Thats because when you open a workbook it becomes the activeworkbook. Thats why there are two workbook variables.Please Login or Register to view this content.
e/ I just realized I forgot to Dim wb2 in my first code. My mistake.
Last edited by Solus Rankin; 08-20-2013 at 02:25 PM.
Strange things happen. The first time i start the SwitchWB after editing it is working fine but the second time when i close every workbook and open TeamA workbook and start SwitchWB again the TeamB opens but also TeamA stays open and share the same workbook. What is wrong ?
Can you attach your workbooks?
I have also an macro with an timer function in my workbook that is activated when i open the workbook. If i turn the timer off it seems to work fine. I have also an Stop_timer macro. Can i put that in your macro so that first the timer stops and then the workbook is saved, open and closed ? On this post the files.
Thanx.
I'm a little confused by that question. It looks like you already called the sub to stop the timer?
Forget that Stop_timer sorry i confused you. But can i put the Stop_timer in your macro or doesn't work that ? Because if the timer is on then it don't work
Possibly. Try: Attachment 259383
Untested.
Yes, that did the trick. It is working fine now. Many thanx for helping me out so quickly.
Glad to help If you are happy with the solution please mark the thread as [SOLVED] using the thread tools at the top.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks