Bomino
Member
Hello,
I currently have code that will display a specific cell value if criteria are met. This code will loop through, checking each criteria and produce a message displaying one cell value. Click ok, will loop again until another cell matches the criteria and produce another message.
What i'd like help with is for the routine to run, loop through all applicable cells, and produce a message at the end, displaying ALL cell values that match the criteria.
Thanks.
I currently have code that will display a specific cell value if criteria are met. This code will loop through, checking each criteria and produce a message displaying one cell value. Click ok, will loop again until another cell matches the criteria and produce another message.
What i'd like help with is for the routine to run, loop through all applicable cells, and produce a message at the end, displaying ALL cell values that match the criteria.
Code:
Private Sub Worksheet_Activate()
Dim i As Variant
Dim FindRange As Range
Set FindRange = Range("E17:F21")
For Each i In FindRange
If i = 0 Then
MsgBox "For " & Range("E16").Value & vbNewLine & i.Offset(0, -1).Value & vbNewLine & "Has a Negative Variance", vbCritical, " Reports"
End If
Next i
End Sub
Thanks.
Last edited: