Hi Nate, give this a try.
Sub ColumnLooper()
Dim iX As Integer
For iX = 1 To 5000
Range("N" & iX).Select
If UCase(ActiveCell.Value) = "Y" Then
MsgBox "The List Cost has changed more than" & vbCrLf & "the allowed changed percentage."
End If
Next iX
End Sub
Jerid
Thanks, it worked. Jerid, you wouldn't happen to know how to do the other problem that I posted would you? The problem should be posted just above this problem. Thanks again
Nate
Dim iX As Integer For iX = 1 To 5000 Range("N" & iX).Select If UCase(ActiveCell.Value) = "Y" Then MsgBox "The List Cost has changed more than" & vbCrLf & "the allowed changed percentage." End If Next iX
I presume you want the message box to appear if there is at least one "Y" in range N7:N5000 and only to appear once (even if there is more than one "Y"). If so, you shouln't use a loop - it's inefficient since it wiil examine all the cells, even after a "Y" has already been found.
Try this instead :-
Dim Y As Range
Set Y = Range("N7:N5000").Find("Y")
If Not Y Is Nothing Then
MsgBox "The List Cost has changed more than" & Chr(13) & _
"the allowed changed percentage."
End If