I have a macro that fills the row that has been selected (with the colour yellow), this code (in the sheet code) is set up so that I can select 1 row in each selection (selections are separated by rows coloured grey), that allows me to selects one row in each selection to create a group of different parts (like a pick list with one part from each department).
I want to add a separate macro to clear all the yellow highlights and return the data in that yellow filled rows back to no colour fill. I DO NOT want to clear all contents from those rows, only remove the colour fill yellow.
I have tried a few different codes but I am struggling to have only clear fill colour yellow and not contents.
I want to add a separate macro to clear all the yellow highlights and return the data in that yellow filled rows back to no colour fill. I DO NOT want to clear all contents from those rows, only remove the colour fill yellow.
I have tried a few different codes but I am struggling to have only clear fill colour yellow and not contents.
VBA Code:
Sub Clear_ValuesYellow()
Application.ScreenUpdating = False
Dim Myrange As Range, cel As Range
Set Myrange = Range("A1:M106")
For Each cel In Myrange
If cel.Interior.ColorIndex = 6 Then
cel.Interior.colourIndex = 0
End If
Next cel
Application.ScreenUpdating = True
End Sub