I was wondering if anyone can help me with my message box notification.
What I want the macro to do is to check the values in column H and if it has a value that is <= 60, then to have a message box pop up with a specific message.
Then I want it to do the same thing for <= 30 with a different message if it finds that value.
The one I have now is working, however it gives me a message box for every single cell it finds with that value. Right now the sheet has 4 cells that have a zero value so I get 4 message boxes.
How can I correct the code to just give me 1 message box notification regardless of how many cells have that value?
Here is the code I have so far:
Private Sub Worksheet_Activate()
For Each cell In Range("H:H")
If cell.Value <= 60 And cell.Value <> "" Then
Range("H:H").Select
MsgBox "60 Days Until Renewal"
End If
Next
End Sub
What I want the macro to do is to check the values in column H and if it has a value that is <= 60, then to have a message box pop up with a specific message.
Then I want it to do the same thing for <= 30 with a different message if it finds that value.
The one I have now is working, however it gives me a message box for every single cell it finds with that value. Right now the sheet has 4 cells that have a zero value so I get 4 message boxes.
How can I correct the code to just give me 1 message box notification regardless of how many cells have that value?
Here is the code I have so far:
Private Sub Worksheet_Activate()
For Each cell In Range("H:H")
If cell.Value <= 60 And cell.Value <> "" Then
Range("H:H").Select
MsgBox "60 Days Until Renewal"
End If
Next
End Sub