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

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,223,774
Messages
6,174,453
Members
452,565
Latest member
curtoliver68

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