Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Working while a Macro is Running.

Working while a Macro is Running

by Allen Wyatt
(last updated August 8, 2015)

3

Macros are great for doing the mundane (or not so mundane) processing that is often necessary with Excel data. After you start to use them, you may find that running macros can consume quite a bit of time. While you are running them, there is very little else that you can do, since Excel won't allow you to do any other work while the macro is chunking away.

The best way to do additional work is to open another instance of Excel. As you are working on one workbook in the foreground, the other instance of Excel continues to work away at the macro in the background. This approach works because Windows allows multiple instances of a program, each in its own workspace. The only thing you cannot do is work in the foreground on the same workbook which the macro is using.

In order to open a second instance of Excel, simply follow the steps you followed to open the first instance. For example, if you started Excel by calling up the Start menu and then the Programs submenu, you could do the same thing to open the second instance.

You should realize that the macro running in the background instance of Excel will be affected by you working on a different instance of Excel in the foreground. This, again, is related to how Windows treats different programs. On most systems, the background programs are given a smaller percentage of the CPU's attention than the foreground program.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (11031) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Working while a Macro is Running.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Unhiding Multiple Worksheets

You can hide a bunch of worksheets at the same time, but Excel makes it impossible to unhide a bunch at once. You can, ...

Discover More

Selecting a Word

Selecting text is a critical skill to possess when you want to work with a Word document. This tip explains how you can ...

Discover More

Putting Character Codes to Work

If you know the character codes for some characters of interest, you can use those codes to do lots of tasks. This tip ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More ExcelTips (ribbon)

Updating Automatically when Opening Under Macro Control

If your workbook contains links, you are normally given the opportunity to update those links when you open the workbook. ...

Discover More

Declaring Variables

Macros depend on the use of variables to do their work. This tip examines how variables are declared in a macro, using the ...

Discover More

Offering Options in a Macro

It is often helpful to get user input within a macro. Here's a quick way to present some options and get the user's response.

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is four less than 9?

2017-09-18 03:18:19

Barry

@Simonkonde
The solution depends on what version of Excel you are using and also if other people are using the workbook with the macros in them (and the macros are needed for them as well).

Excel itself must have its security settings set to allow macros to run (this is covered elsewhere in another Tip https://excelribbon.tips.net/T011194_Disabled_Macros.html ). I would on newer versions of Excel set u a "trusted" location and store the workbook there. Thirdly, digitally signing an application will allow a higher security setting to be used.


2017-09-17 14:38:02

Simukonde Moses

Thank you for the tips, my request is most of the time i open the macros, they are disabled and every time i have to anable. how can i make it enabled permanently like other computers


2016-09-22 08:10:27

Barry

It is perfectly possible to work on a workbook with a macro also running. To do this you need to place a "DoEvents" command in an inner loop that is frequently called from the macro that is running in "background".

The DoEvents allows Excel to process User inputs. It is important that this command is called frequently otherwise Excel will become very unresponsive. Obviously is takes time to process the User inputs so this can slow down the macro even when there are no User inputs to process (it takes time just to check if there are any inputs to process).

The other thing to be borne in mind is if the macro is operating on the user inputted values, so there can be a "clash" between what the User is trying to and what the macro is trying to do. This can be quite disconcerting if the User does know what is going on.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.