conditional font color

ndendrinos2

New Member
Joined
Nov 19, 2022
Messages
11
Office Version
  1. 2003 or older
Platform
  1. Windows
hello to all ... I need either a conditional formatting formula or a VBA maco to do this:
I select colum D and format font color white
I add a conditional format to do this: if in adjacent cells(C3:D1000) have a value then change font color to automatic
Hope I explain it well but again I'm 78 so who knows..... thank you
 
maybe I can achieve this using VBA ... I've recorded this macro
Sub Macro1()

Range("E10").Select
Selection.AutoFill Destination:=Range("E10:E11"), Type:=xlFillDefault
Range("E10:E11").Select
End Sub

What I need to do is replace E10 by the last populated cell in column E ... copy the cell ... then paste to cell one below in same column

Thank you
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Sub Macro2()
Range("E" & Cells.Rows.Count).End(xlUp).Select

End Sub

this will get me to the last populated cell in Column E ..... now I need to drag it down to the next row in the same column
Thanks
 
Upvote 0
If you want to go down the VBA path, then you probably need a worksheet_change event code. See this on how to add it: Excel VBA: The Magic of the Worksheet Change Event, and code like the following should do what you want:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Range("C3:D1000"), Target) Is Nothing Then
        Application.ScreenUpdating = False
        For Each c In Range("E3:E1000")
            If WorksheetFunction.CountA(Range(c.Offset(, -2), c.Offset(, -1))) > 0 Then
                c.Font.Color = vbBlack
            Else
                c.Font.Color = vbWhite
            End If
        Next c
        Application.ScreenUpdating = True
    End If
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,056
Messages
6,122,907
Members
449,096
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