Maria Clara
New Member
Hi guys, I need a macro to check in a specific column if there is at least one single value <> than the one stored on variable Plant, and if it does the macro should not run.
I'm trying to use the code below but it does not check first for a <> value but to the same value and because of that the macro is not working.
Can anyone shed a light on this? Thanks a lot!
I'm trying to use the code below but it does not check first for a <> value but to the same value and because of that the macro is not working.
Can anyone shed a light on this? Thanks a lot!
Code:
Sub HistoricalYES()
Dim Plant As String
Dim rFound As Range
Plant = Sheets("RM").Range("E17").Value
Sheets("ALL POs Report").Select
Columns("C:C").Select
Set rFound = Selection.Find(What:=Plant, LookAt:=xlWhole)
If Not rFound Is Nothing Then
MsgBox "OK, please move to next question", vbInformation
Else
MsgBox "Attention! You report contains more than one Plant value, please correct!", vbCritical
End If
End Sub