I found this code that identifies a cell that is filled with background color and then highlights the column header it is in. How can i change this so it appends text to the front of the cell that is shaded instead. So if the cell is yellow and says "Automotive" in it, after running the script it would say something like
"**CHANGED** - Automotive"
Sub TagColumns()
Dim headers As Range, body As Range, col As Long, found As Boolean
' define the columns for the headers and body
Set headers = ActiveSheet.UsedRange.Rows(1).Columns
Set body = ActiveSheet.UsedRange.Offset(1).Columns
' iterate each column
For col = 1 To headers.Count
' search for any color in the column of the body
found = VBA.IsNull(body(col).DisplayFormat.Interior.ColorIndex)
' set the header to red if found, green otherwise
headers(col).Interior.Color = IIf(found, vbRed, vbGreen)
Next
End Sub
Bookmarks