Switching back to Excel at the end of a macro

Gadgetgav

New Member
Joined
Aug 26, 2009
Messages
29
Hi Guys,

I have a very large macro that takes about an hour to run (this varies with each run), while I run this macro I also do other things on other programs.

My question is: is there any VBA code that I can add to the macro so it brings Excel back to the front (switching from the other program I'm running back to Excel) when it has finished so that I don't have to keep checking excel to see if it's done yet?

any help will be appreciated

Thanks in advance

Gavin
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
If I were you I'd code in a message box at the end of the routine to prompt you that it's done. It might not restore the Excel window but it will amost certainly flash on your task bar.

Example:

Code:
Sub MyMacro
    'some code here
    MsgBox "Macro is done!"
End Sub
 
Upvote 0
If I were you I'd code in a message box at the end of the routine to prompt you that it's done. It might not restore the Excel window but it will amost certainly flash on your task bar.

Example:

Code:
Sub MyMacro
    'some code here
    MsgBox "Macro is done!"
End Sub

Thanks but I tried that and it shows the msgbox but doesn't flash on my taskbar so I still don't know about it until I minimise the other program, that's why I wanted to know if there was another way.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

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