Calendar Coding Using Conditional Formula With A Color Code Of Users Choosing

ClwnMan76

New Member
Joined
Oct 26, 2009
Messages
28
Office Version
  1. 365
Platform
  1. Windows
I'm having trouble learning this "loop" feature in vba, or even if it's the correct way to do what I'm wanting. I'm looking at changing the day's background fill, or the "interior". I figured out how to do it one box at time, but it seems as though that probably isn't the BEST way to do it and would probably make you professionals cringe. The version I was going to work on is below (I'm sure it's not even correct but I was piecing together what I found on the web to try and make it work), but I'll put that to the side until I hear from you more experienced VBAers.

Appreciate any help you have time to afford me!!!





Code:
    Dim rng As Range    

Set rng = Range("a10:c16")
    
            With Sheet2.Range("10:16")
        .FormatConditions.Delete
    End With
       
            With Range("a10:c16")
            rng.FormatConditions.Delete
                        .FormatConditions.Add Type:=xlExpression, Formula1:="=$C$10=""t"""
             With .FormatConditions(.FormatConditions.Count)
            .SetFirstPriority
            With .Interior
                .PatternColorIndex = xlAutomatic
                .ColorIndex = Sheet1.Range("h2")
                .TintAndShade = 0
            End With
        End With
    End With
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.

Forum statistics

Threads
1,224,763
Messages
6,180,830
Members
452,998
Latest member
Minkie88

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