Change Font Color

JTL9161

Active Member
Joined
Aug 29, 2012
Messages
342
I have a spreadsheet that is updated daily with about 1000 rows. I use different color fonts to breakout the dates through out the month. Each day some new rows of data are added and previous rows are updated. When the previous rows are updated they font color is automatic (black) yet the rest of the row is another color font based on the day of the month. I filter the column(s) that are updated to show just automatic fonts.

My question. What macro code can I add to my existing updating code that would go down the column (lets say column "C") to each cell with automatic font the look either at column "B" or "D" and change the data in column "C" to the same color as the adjacent column(s)? Or is this not doable?

Thank You,
James
 

Some videos you may like

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

DanteAmor

Well-known Member
Joined
Dec 3, 2018
Messages
12,585
Office Version
2007
Platform
Windows
Try the following, to change the font color of the column C according to column B

Code:
Sub test_color()
    Dim c As Range
    For Each c In Range("C2", Range("C" & Rows.Count).End(xlUp))
        c.Font.Color = c.Offset(, -1).Font.Color
    Next
End Sub
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,542
Messages
5,511,938
Members
408,868
Latest member
AndrewLeonard

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...
Top