matheuscfernandes
New Member
- Joined
- May 24, 2010
- Messages
- 6
Hi,
I would like to create a pop-up message in Excel, where it will take any value from C12 to AA12 and compare it to a value in C68. If any value in the column between C12 and AA12 are greater than the value in C68, then a message should pop-up saying "Incorrect Value". This Macro should be run continuously, everytime a value is changed in any cells on the spreadsheet.
This is what I have so far:
Private Sub Worksheet_Change(ByVal Target As Range) - I don't know if this line is correct
Dim rDetect As Range, riDetect As Range
Set rDetect = Range("C12:AA12")
For Each riDetect In rDetect
If riDetect.Value > "C68" Then
MsgBox "AVE Value Is Incorrect"
End If
End Sub
Thanks for your help.
I would like to create a pop-up message in Excel, where it will take any value from C12 to AA12 and compare it to a value in C68. If any value in the column between C12 and AA12 are greater than the value in C68, then a message should pop-up saying "Incorrect Value". This Macro should be run continuously, everytime a value is changed in any cells on the spreadsheet.
This is what I have so far:
Private Sub Worksheet_Change(ByVal Target As Range) - I don't know if this line is correct
Dim rDetect As Range, riDetect As Range
Set rDetect = Range("C12:AA12")
For Each riDetect In rDetect
If riDetect.Value > "C68" Then
MsgBox "AVE Value Is Incorrect"
End If
End Sub
Thanks for your help.
Last edited: