ClwnMan76
New Member
- Joined
- Oct 26, 2009
- Messages
- 28
- Office Version
- 365
- Platform
- 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!!!
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