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?
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,651
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,651
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.:)
 

Forum statistics

Threads
1,084,878
Messages
5,380,420
Members
401,676
Latest member
BobH

Some videos you may like

This Week's Hot Topics

Top