Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Calculations And Order In Macros
I have a macro that prints a message to the user, then calculates hundreds of
links (several minutes), then needs to clear the message. The macro is basically, "print message, calculate, clear message". Will Excel wait until it finishes updating the links before going to the next step in the macro to clear the message? I cannot use the "wait" or "OnTime" command because there is no way to predict how long the calculation will take. Thanks. |
#2
|
|||
|
|||
You say "print the message" and you say "clear the message". Do you have a
message that is being sent to the printer or do you have a message box pop up on the screen? If you have a message box (using the MsgBox command) pop up on the screen, all code execution will stop until you click the OK button in that message box. IOW, the code to "calculate" will not run until the message box has been manually cleared. Does this help? Otto "Carl Bowman" wrote in message ... I have a macro that prints a message to the user, then calculates hundreds of links (several minutes), then needs to clear the message. The macro is basically, "print message, calculate, clear message". Will Excel wait until it finishes updating the links before going to the next step in the macro to clear the message? I cannot use the "wait" or "OnTime" command because there is no way to predict how long the calculation will take. Thanks. |
#3
|
|||
|
|||
Thanks but your answer did not answer the question because I failed to give
you enough information. I am inserting a message to the user in one of the cells, then recalculating the workbook, then clearing the message by clearing the cell. Thanks again. "Otto Moehrbach" wrote: You say "print the message" and you say "clear the message". Do you have a message that is being sent to the printer or do you have a message box pop up on the screen? If you have a message box (using the MsgBox command) pop up on the screen, all code execution will stop until you click the OK button in that message box. IOW, the code to "calculate" will not run until the message box has been manually cleared. Does this help? Otto "Carl Bowman" wrote in message ... I have a macro that prints a message to the user, then calculates hundreds of links (several minutes), then needs to clear the message. The macro is basically, "print message, calculate, clear message". Will Excel wait until it finishes updating the links before going to the next step in the macro to clear the message? I cannot use the "wait" or "OnTime" command because there is no way to predict how long the calculation will take. Thanks. |
#4
|
|||
|
|||
Carl
The code works in the sequence it is written. It executes one line of code, then moves on to the next line, and so on. It doesn't skip lines or jump around in the code unless the code is written specifically to do so. HTH Otto "Carl Bowman" wrote in message ... I have a macro that prints a message to the user, then calculates hundreds of links (several minutes), then needs to clear the message. The macro is basically, "print message, calculate, clear message". Will Excel wait until it finishes updating the links before going to the next step in the macro to clear the message? I cannot use the "wait" or "OnTime" command because there is no way to predict how long the calculation will take. Thanks. |
#5
|
|||
|
|||
Thanks for the help. That was what I needed to know.
"Carl Bowman" wrote: I have a macro that prints a message to the user, then calculates hundreds of links (several minutes), then needs to clear the message. The macro is basically, "print message, calculate, clear message". Will Excel wait until it finishes updating the links before going to the next step in the macro to clear the message? I cannot use the "wait" or "OnTime" command because there is no way to predict how long the calculation will take. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|