Switching back to Excel at the end of a macro

Gadgetgav

New Member
Joined
Aug 26, 2009
Messages
27
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
 

Some videos you may like

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Jon von der Heyden

MrExcel MVP, Moderator
Joined
Apr 6, 2004
Messages
10,808
Office Version
  1. 365
Platform
  1. Windows
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
 

Gadgetgav

New Member
Joined
Aug 26, 2009
Messages
27
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,176
Messages
5,600,154
Members
414,367
Latest member
dw970906

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
Top