I have a worksheet with a lot of other information as well as a section where elbows need to be categorized according to their degrees. I employ VBA. I can't just search for 45, 90, etc. using a Like or InStr function because it returns other content. To obtain the degree symbol and the number, I used the formula below, although it only returns values if both appear in the cell, not necessarily next to one another. Therefore, it causes problems if I enter data in the cell that reads "Qty 90 of 45° elbows" and "Qty 45 of 90° elbows."
For Each cell In Range("A1:A5000")
If InStr(cell.Value, ChrW(176)) > 0 And cell Like "*45*" Then
cell.Offset(0,5).Value = "45 Degree"
End If
Next cell
I figure I can do a workaround and try to extract info from the cell, enter it into another one, and then search on that. But that's a pain. Any ideas?