help msgbox appear when sheet is inactive

akforsyt

New Member
Joined
Apr 9, 2009
Messages
18
I need some help. Everyone who has posted in these Forums has been incredibly helpful so far. I wasn't able to find any information on this one however.

I have a sheet that alerts me with a message box when a set time has passed. This works fine as long as I have this sheet active. I would also like to get the same alert when I have a different sheet selected.

For example, in Sheet 1, cell A1 I have entered 12:00. If I am on Sheet 1 and it is after 12:00 I get a message box. However, if I am on Sheet 2, the alert never pops up.

Is it possible to have the message box pop up no matter which sheet I am on?
 

Some videos you may like

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Hello and welcome to MrExcel.

Please post your code.
 

akforsyt

New Member
Joined
Apr 9, 2009
Messages
18
This is the part of the code I am dealing with .....
Cell AZ1 has the current time
Cell F3 has the input time


With Worksheets("Testing Schedule")
If Not IsEmpty(Range("F3")) Then
If Range("F3") <= Range("AZ1") Then
MsgBox "Stop", vbOKOnly + vbExclamation
End If
End If
End With

When I am on the Testing Schedule sheet this works fine. When I am on another sheet it does not. This code is in a module.
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try qualifying the ranges

Rich (BB code):
With Worksheets("Testing Schedule")
    If Not IsEmpty(.Range("F3")) Then
        If .Range("F3") <= .Range("AZ1") Then
            MsgBox "Stop", vbOKOnly + vbExclamation
        End If
    End If
End With
 

akforsyt

New Member
Joined
Apr 9, 2009
Messages
18
That worked great. Thank you so much for the help and the quick replies.:)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,232
Messages
5,594,962
Members
413,954
Latest member
mrsandy

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