Sub 랭킹서식처리()
' Excel 2010
' 랭킹서식처리 매크로
' 조건부서식을 이용한 서식처리 매크로

'
    Range("BA5:BA66").Select '서식처리 영역
    Selection.FormatConditions.AddTop10 '조건부서식 랭킹 처리 추가
    Selection.FormatConditions(Selection.FormatConditions.Count).SetFirstPriority
    With Selection.FormatConditions(1)
        .TopBottom = xlTop10Top '순위
        .Rank = 5 '5순위까지
        .Percent = False
    End With
    With Selection.FormatConditions(1).Font '폰트처리
        .Bold = True
        .Italic = False
        .Color = -16776961 '빨강
        .TintAndShade = 0
    End With
    With Selection.FormatConditions(1).Interior '배경처리
        .PatternColorIndex = xlAutomatic
        .Color = 65535 '노랑
        .TintAndShade = 0
    End With
    Selection.FormatConditions(1).StopIfTrue = False
    ActiveWindow.SmallScroll Down:=-12
    Selection.FormatConditions.Delete '서식 취소
End Sub

+ Recent posts