Mookiemines
New Member
- Joined
- Jul 31, 2022
- Messages
- 2
- Office Version
- 365
- Platform
- Windows
I have script that will look that will search for specific text within a cell in a specified column. If found, it will change the interior color for the row of the table. If not found, the script will loop to the next cell in the column until the last column is reached. This script is working well, however, I would like to add a second search in another column if the specific text is found in the first search. It would need to loop through the results from the first search to look in the other column for a value that is >499. Only if both criteria are would the row's interior color change.
I cannot figure out how to add the second criteria.
Result from current VBA:
Desired result after second criteria is found:
Current VBA script:
Any suggestions would be greatly appreciated.
I cannot figure out how to add the second criteria.
Result from current VBA:
Desired result after second criteria is found:
Current VBA script:
VBA Code:
Dim SrchRng3 As Range
Dim c3 As Range, f As String
'DF
Set SrchRng3 = ActiveSheet.Range("I1", ActiveSheet.Range("I65536").End(xlUp))
Set c3 = SrchRng3.Find("DF", LookIn:=xlValues)
If Not c3 Is Nothing Then
f = c3.Address
Do
With ActiveSheet.Range("A" & c3.Row & ":N" & c3.Row)
.Font.ColorIndex = 2
.Interior.ColorIndex = 11
End With
Set c3 = SrchRng3.FindNext(c3)
Loop While c3.Address <> f
End If
Any suggestions would be greatly appreciated.