RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 788
- Office Version
- 2010
- Platform
- Windows
Hi all, got two examples for you. The first one (Off Sale) formats correctly, the second one (Unrouted) does not:
What I'm trying to do is filter down to "Unrouted" in column B, which it does, and with all cells selected (which they are), remove any interior cell colours and then colour the font a kind of middle grey so they don't look prominent on the page.
For some reason, this seems to just colour the text as white, even though I got the codes from recording a macro and just taking regular text and colouring it grey. Any reasons why this doesn't work? Thank you.
VBA Code:
Range("A2:AF" & lastrow).AutoFilter field:=2, Criteria1:="Off Sale"
If Not Range("A2:A" & lastrow).SpecialCells(xlCellTypeVisible).Count > 1 Then
Range("A1").Select
Else
formatrng.SpecialCells(xlCellTypeVisible).Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent4
.TintAndShade = 0.399975585192419
.PatternTintAndShade = 0
End With
End If
Range("A2:AF" & lastrow).AutoFilter field:=2, Criteria1:="Unrouted"
If Not Range("A2:A" & lastrow).SpecialCells(xlCellTypeVisible).Count > 1 Then
Range("A1").Select
Else
formatrng.SpecialCells(xlCellTypeVisible).Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.TintAndShade = -0.349986266670736
End With
End If
What I'm trying to do is filter down to "Unrouted" in column B, which it does, and with all cells selected (which they are), remove any interior cell colours and then colour the font a kind of middle grey so they don't look prominent on the page.
For some reason, this seems to just colour the text as white, even though I got the codes from recording a macro and just taking regular text and colouring it grey. Any reasons why this doesn't work? Thank you.