I am trying to create a macro that will determine if a number in each cell in a range is greater than 25. However some of the data I am working with has a "-" in the cell to separate multiple numbers so I would need the macro to take the largest number from within the cell to determine if it is greater than 25. Essentially the cells in the range would look like:
12
28
0
1-24
4
6-33
This is the module that I was using for a similar task, but is no longer accurate. I appreciate any help.
Sub MaxNumFound()
Dim iCell As Range
For Each iCell In Range("A2:A" & Cells(Rows.Count, "A").End(xlUp).Row)
If iCell.Value > 25 Then
iCell.Offset(0, 11) = "Yes"
ElseIf iCell.Value <= 25 Then
iCell.Offset(0, 11) = "No"
Else
End If
Next iCell
End Sub
Bookmarks