Hi there - I'm kinda new to "Loops."
The code snippet below shows that I'm running a loop through column CH and changing the cell color of values in column A based on the results of that loop.
The "key" to the loop is the word "ERROR."
However, what I NEED to do is to have some flexibility there - I need to be able to key the loop on a word contained within a text string.
For instance, right now I need to "focus" on the word "Record."
There will be several different text strings - about half may contain "Record" (Record not found, Record incorrect, No record created, etc.)
So I need to search all text strings and just pull out those containing "Record"/"record."
Thanks in advance!
The code snippet below shows that I'm running a loop through column CH and changing the cell color of values in column A based on the results of that loop.
The "key" to the loop is the word "ERROR."
However, what I NEED to do is to have some flexibility there - I need to be able to key the loop on a word contained within a text string.
For instance, right now I need to "focus" on the word "Record."
There will be several different text strings - about half may contain "Record" (Record not found, Record incorrect, No record created, etc.)
So I need to search all text strings and just pull out those containing "Record"/"record."
Thanks in advance!
Code:
For i = 3 To Last_Row_ColCH
'So, if there is an "ERROR" in a Cell in Column CH - the CORRESPONDING Cell in Column A will CHANGE COLOR.
If Range("CH" & i).Value = "ERROR" Then Range("A" & i).Interior.ColorIndex = 3
'Continues the LOOP - this will run to the LAST ROW in Column CH CONTAINING a VALUE.
Next i