Last active
May 28, 2022 04:41
-
-
Save eggist77/3143a27721ce867416f65f404f7bf17f to your computer and use it in GitHub Desktop.
vba formatCondition.vb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub formatCondition() | |
Dim r As Range | |
Dim formatCondition As FormatCondition | |
'範囲設定 | |
Set r = Range("A1:A5") | |
'条件付き書式の追加 | |
Set formatCondition = r.FormatConditions.Add(Type:=xlTextString, String:="OK", TextOperator:=xlContains) | |
'書式の指定(濃い緑の文字、緑の背景) | |
With formatCondition.Font | |
.Color = RGB(0, 97, 0) | |
.TintAndShade = 0 | |
End With | |
With formatCondition.Interior | |
.PatternColorIndex = xlAutomatic | |
.Color = RGB(198, 239, 206) | |
.TintAndShade = 0 | |
End With | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment