This macro below will allow you to add as many search criteria as yo
like.
It will select all values (either constants or formula values) tha
match. You can modify the code to work with a form, with a next butto
for instance, that would allow you to look at each cell that passed th
criteria.
The current example looks for values greater than a min value, les
than a max value. Paste the below code into a module, then populat
your excel sheet with random numbers and give it a try.
Sub MS()
Dim myrange As Object
Dim myrange2 As Object
Dim myFinishedRange As Object
Dim rngConstants As Object, rngFormulas As Object
Dim MinVal, MaxVal
' set your criteria here
MinVal = 500
MaxVal = 1000
On Error Resume Next
Set rngConstants = ActiveSheet.Cells.SpecialCells(xlConstants)
Set rngFormulas = ActiveSheet.Cells.SpecialCells(xlFormulas)
For Each cellz In rngConstants
'/// put your search criteria here
If (cellz.Value >= MinVal And cellz.Value <= MaxVal) Then
'///
If n = 0 Then
Set myrange = cellz
n = 1
Else
Set myrange = Union(myrange, cellz)
End If
End If
Next cellz
myrange.Select
On Error GoTo endit
n = 0
For Each cellz In rngFormulas
'// same criteria here
If (cellz.Value >= MinValue And cellz.Value <= MaxVal) Then
'//
If n = 0 Then
Set myrange2 = cellz
n = 1
Else
Set myrange2 = Union(myrange2, cellz)
End If
End If
Next cellz
On Error Resume Next
Set myFinishedRange = Union(myrange, myrange2)
myFinishedRange.Select
Exit Sub
endit:
Set myFinishedRange = myrange
If myrange Is Nothing Then Exit Sub
myFinishedRange.Select
End Su