I'm looking for some code to search through a range and return the row number of each cell in that range that fits a certain criteria and list those rows.
Previously I have only been requiring the first value so have been using the code:
Dim Criteria1 As Single
Dim Criteria2 As Single
Dim Required As Integer
Dim Range1 As Range
Dim GearNeg1 As Integer
SetColumn = 24
Set Range1 = Sheets("X").Range("A2:BT72").Columns(SetColumn).Cells
Criteria1 = Sheets("X").Range("P111").Value
Criteria2 = Sheets("X").Range("Q111").Value
For Each Cell In Range1
If Cell.Value < Criteria1 And Cell.Value > Criteria2 Then
Required = Cell.row
Exit For
End If
Next
I've been playing around with adding a for loop to return all the row values for the values that meet the criteria to a list. However am struggling and can only seem to hit the first value found every time.