Excel VBA Msg Box when cell meets criteria
Solved/Closed
Iangough16
-
Feb 9, 2009 at 06:33 AM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 13, 2010 at 10:13 PM
rizvisa1 Posts 4479 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 13, 2010 at 10:13 PM
Related:
- Excel vba msgbox when cell meets criteria
- Excel pop up message based on cell value - Best answers
- Excel pop up message based on cell value with vba - Best answers
- If cell contains (multiple text criteria) then return (corresponding text criteria) ✓ - Excel Forum
- How to enable vba in excel - Guide
- Number to words in excel without vba - Guide
- Excel conditional formatting if another cell contains specific text ✓ - Excel Forum
- Excel date format dd.mm.yyyy - Guide
2 replies
This code assumes that what you are looking for is in column A.
Private Sub Find_Criteria()
Dim i
Dim r
r = Range("A65536").End(xlUp).Row
i = 1
For I = I To r
If Range("A" & i) = "criteria" Then
MsgBox "Found" & " " & Range("A" & i).Address
End If
Next i
End Sub
If you are looking for certain criteria in a range of cells, then try something like this.
Private Sub Find_Criteria()
Dim I As Variant
Dim FindRange As Range
Set FindRange = Range("A1:K50")
For Each I In FindRange
If I = "criteria" Then
MsgBox "Found" & " " & i.Address
End If
Next i
End Sub
Private Sub Find_Criteria()
Dim i
Dim r
r = Range("A65536").End(xlUp).Row
i = 1
For I = I To r
If Range("A" & i) = "criteria" Then
MsgBox "Found" & " " & Range("A" & i).Address
End If
Next i
End Sub
If you are looking for certain criteria in a range of cells, then try something like this.
Private Sub Find_Criteria()
Dim I As Variant
Dim FindRange As Range
Set FindRange = Range("A1:K50")
For Each I In FindRange
If I = "criteria" Then
MsgBox "Found" & " " & i.Address
End If
Next i
End Sub