Conditional Formatting Based on the Font Color of the Linked Cell

chelseasikoebs

Board Regular
Joined
Mar 9, 2009
Messages
61
I have been working really hard to make a spreadsheet super user-friendly for an office manager. The last thing I want to do, I can't seem to find when I Google it. What I have are 2 tabs: INPUT and LOGS. The INPUT tab is for doing just that: input the information and it will populate into the LOGS tab. To avoid confusion and possible user error on the LOGS tab, I'd like to keep it to where she never has to modify anything in that tab. But, there are many times when she needs to make the color of the text in some cells red to stand out. I would prefer that she make that color change in the INPUT tab and have it change automatically in the LOGS tab as soon as she changes the color. Is there vba code for this?? Something like If INPUT.cell.font.color = RGB(inputRedNo, inputGrnNo, inputBluNo) Then corresponding.LOGS.cell.font.color = RGB(inputRedNo, inputGrnNo, inputBluNo)?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Is there vba code for this?? Something like If INPUT.cell.font.color = RGB(inputRedNo, inputGrnNo, inputBluNo) Then corresponding.LOGS.cell.font.color = RGB(inputRedNo, inputGrnNo, inputBluNo)?

I have this code. It returns the value of the font color within its own cell, but is there a way to only READ that value and apply it to a corresponding cell in the other tab?

Code:
Option Explicit
Sub RgbInteriorAndFont()
    Dim rThisCell As Range
    Dim sFontColor As String
     
     
     
    For Each rThisCell In Range("d10:d20")
        sFontColor = Hex(rThisCell.Font.Color)
         
        sFontColor = "000000" & sFontColor
        sFontColor = Right(sFontColor, 6)
        sFontColor = "R" & CInt("&H" & Right(sFontColor, 2)) & _
        " G" & CInt("&H" & Mid(sFontColor, 3, 2)) & _
        " B" & CInt("&H" & Left(sFontColor, 2))
         
        rThisCell.Value = sFontColor
    Next rThisCell
     
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,093
Latest member
dbomb1414

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top