ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to stop 'Egg Timer' (https://www.excelbanter.com/excel-programming/420847-how-stop-egg-timer.html)

MichaelRobert

How to stop 'Egg Timer'
 
I want to stop the (part of the program that presents the) 'Egg Timer'
symbol when I run my macro.

If the user clicks on cell "b3" when it already contains a Part Number, I
want a message Box to appear. The following code does the trick, except that
the Egg Timer symbol appears until the OK button is clicked in the MsgBox.

If IsError(Range("B3").Value) = False Then GoTo DoubleClick
(If "True" code snipped)

DoubleClick:
Sheets("Main Page").Select
MsgBox "Part Number has already been assigned."
Range("B2").Select
Exit Sub

What am I missing?

Thanks.

Mike

John Bundy

How to stop 'Egg Timer'
 
Your program is "stepping on itself", put a DoEvents between the sheet select
and the message box, that should fix you up.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"MichaelRobert" wrote:

I want to stop the (part of the program that presents the) 'Egg Timer'
symbol when I run my macro.

If the user clicks on cell "b3" when it already contains a Part Number, I
want a message Box to appear. The following code does the trick, except that
the Egg Timer symbol appears until the OK button is clicked in the MsgBox.

If IsError(Range("B3").Value) = False Then GoTo DoubleClick
(If "True" code snipped)

DoubleClick:
Sheets("Main Page").Select
MsgBox "Part Number has already been assigned."
Range("B2").Select
Exit Sub

What am I missing?

Thanks.

Mike


Jim Cone[_2_]

How to stop 'Egg Timer'
 
You are missing the line...
Application.Cursor = xlDefault
--
Jim Cone
Portland, Oregon USA



"MichaelRobert"
wrote in message
I want to stop the (part of the program that presents the) 'Egg Timer'
symbol when I run my macro.

If the user clicks on cell "b3" when it already contains a Part Number, I
want a message Box to appear. The following code does the trick, except that
the Egg Timer symbol appears until the OK button is clicked in the MsgBox.

If IsError(Range("B3").Value) = False Then GoTo DoubleClick
(If "True" code snipped)

DoubleClick:
Sheets("Main Page").Select
MsgBox "Part Number has already been assigned."
Range("B2").Select
Exit Sub

What am I missing?
Thanks.
Mike

MichaelRobert

How to stop 'Egg Timer'
 
John:

Many thanks. That did the trick. Now I need to understand why I had created
the problem, and how DoEvents fixed it! But it is fun to learn these things.

Mike

"MichaelRobert" wrote:

I want to stop the (part of the program that presents the) 'Egg Timer'
symbol when I run my macro.

If the user clicks on cell "b3" when it already contains a Part Number, I
want a message Box to appear. The following code does the trick, except that
the Egg Timer symbol appears until the OK button is clicked in the MsgBox.

If IsError(Range("B3").Value) = False Then GoTo DoubleClick
(If "True" code snipped)

DoubleClick:
Sheets("Main Page").Select
MsgBox "Part Number has already been assigned."
Range("B2").Select
Exit Sub

What am I missing?

Thanks.

Mike



All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com