Caitlin535
New Member
- Joined
- Jan 8, 2016
- Messages
- 21
Hello -
My worksheet has a set up in which users essentially put a value in column A, a value in column B, and then Column C = B-A. Each time a new value is calculated in column C, I want a message box to pop up - I need to it give one message if the value is < 8.0, and another message if the value is > 8.0 (don't need a message for 8.0 exactly).
I've been trying to do this with Data Validation, but it doesn't seem to want to work - I can't get a message to pop up at all, which is frustrating. I also tried the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range, r As Range
Set A = Range("C3:C16")
If Intersect(Target, A) Is Nothing Then Exit Sub
For Each r In Target
If r.Value < 8.0 Then
MsgBox "You have indicated working fewer than 8.0 hours on this day. Please indicate how to account for hours." & r.Address
End If
Next r
End Sub
But it doesn't work either - AND, it would be my second Worksheet_Change entry, and I know only one is allowed per sheet (and combining more than one together seems beyond me!).
Any advice?
Thank you so so much!
My worksheet has a set up in which users essentially put a value in column A, a value in column B, and then Column C = B-A. Each time a new value is calculated in column C, I want a message box to pop up - I need to it give one message if the value is < 8.0, and another message if the value is > 8.0 (don't need a message for 8.0 exactly).
I've been trying to do this with Data Validation, but it doesn't seem to want to work - I can't get a message to pop up at all, which is frustrating. I also tried the following code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim A As Range, r As Range
Set A = Range("C3:C16")
If Intersect(Target, A) Is Nothing Then Exit Sub
For Each r In Target
If r.Value < 8.0 Then
MsgBox "You have indicated working fewer than 8.0 hours on this day. Please indicate how to account for hours." & r.Address
End If
Next r
End Sub
But it doesn't work either - AND, it would be my second Worksheet_Change entry, and I know only one is allowed per sheet (and combining more than one together seems beyond me!).
Any advice?
Thank you so so much!