farmerscott
Well-known Member
- Joined
- Jan 26, 2013
- Messages
- 818
- Office Version
-
- 365
- Platform
-
- Windows
Hi Everybody,
I have the following code that looks for-
cells in Col A that is not vbGreen
cells in Col B that is not vbYellow
cells in Col C that is not vbBlue
Across Cols A,B and C are related records.
Because the records are contextual with the record above or below (that row) I would like to somehow go through the sheet where the code takes me to the next non coloured cell, I visually check it and if it is OK I click on Col A and it turns green, click on Col B it turns yellow and so on for Col C. Onto the next non coloured record. Something like the mannual find and replace except with colours within the cells.
Since I am learning how to write VBA I would prefer some guideance rather than written code. I think I can do the change in colours by a double click change event but I don't know how to stop the code, mannually do what I want to do then restart the code again.
Alternatively, would it just be easier to copy the non coloured cells (with the row above and below) to a separate sheet, then do the change of colours and then reinsert the changes back into my original list?
Any thoughts?
thanks
FarmerScott
I have the following code that looks for-
cells in Col A that is not vbGreen
cells in Col B that is not vbYellow
cells in Col C that is not vbBlue
Across Cols A,B and C are related records.
Code:
Sub check_tags_to_delete()
Dim lr As Long
With Sheets("Matches")
lr = Worksheets("matches").Cells(Rows.Count, "A").End(xlUp).Row
For x = 1 To lr Step 1
If .Range("A" & x).Interior.Color <> vbGreen Or .Range("B" & x).Interior.Color <> vbYellow Or .Range("C" & x).Interior.Color <> vbBlue Then
'do mannual find and replace here
End If
Next x
End With
End Sub
Because the records are contextual with the record above or below (that row) I would like to somehow go through the sheet where the code takes me to the next non coloured cell, I visually check it and if it is OK I click on Col A and it turns green, click on Col B it turns yellow and so on for Col C. Onto the next non coloured record. Something like the mannual find and replace except with colours within the cells.
Since I am learning how to write VBA I would prefer some guideance rather than written code. I think I can do the change in colours by a double click change event but I don't know how to stop the code, mannually do what I want to do then restart the code again.
Alternatively, would it just be easier to copy the non coloured cells (with the row above and below) to a separate sheet, then do the change of colours and then reinsert the changes back into my original list?
Any thoughts?
thanks
FarmerScott