Thank you so much. That is just what I need. Thank you especially for your explicet step by step instructions.
One problem is that I am working in a report that my boss created, and his background colors are not in the Colorindex list.
I think it would work to see if the background color maches a refference cell perhaps something like this:
Sub OldChanges1()
Dim rCurrent As Range
Dim rMissed As Range
Dim rCompleted As Range
rCurrent = Range("'Reference (DO NOT DELETE)'!A1")
rMissed = Range("'Reference (DO NOT DELETE)'!A3")
rCompleted = Range("'Reference (DO NOT DELETE)'!A2")
'Cell Interior Colors
Const ciBrown As Long = rCurrent.Interior.ColorIndex
Const ciBlue As Long = rCompleted.Interior.ColorIndex
Const ciPink As Long = rMissed.Interior.ColorIndex
Const ciWhite As Long = 2
'Font Colors
Const fcBlack As Long = 1
Const fcWhite As Long = 2
Dim C As Long
Dim colArea As Range
Dim LastCell As Range
Dim R As Long
Dim Rng As Range
Set Rng = Range("H:H,M:N,P:Q,S:T,V:W,Y:Y,AA:AB,AD:AE,AG:AG")
For Each colArea In Rng.Areas
Set LastCell = colArea.Find("*", , xlFormulas, xlWhole, xlByRows, xlPrevious, False)
If Not LastCell Is Nothing Then
C = LastCell.Column
For R = 5 To LastCell.Row
Select Case Cells(R, C).Interior.ColorIndex
Case ciBlue
Cells(R, C).Font.ColorIndex = fcWhite
Case ciWhite
Cells(R, C).Font.ColorIndex = fcBlack
Case ciBrown
Cells(R, C).Font.ColorIndex = fcBlack
Case ciPink
Cells(R, C).Font.ColorIndex = fcBlack
End Select
Next R
End If
Next colArea
End Sub
I tried that, but it won't set that colorindex as a constant. Any thoughts?
JJH
Bookmarks