본문 바로가기
Excel VBA

XlRgbColor

2023. 7. 18.

XlRgbColor enumeration은 RGB색상값을 정의하는 상수입니다.

XlRgbColor enumeration (Excel)

Office VBA reference topic

learn.microsoft.com

XlRgbColor 열거형 값은 모두 142개가 있습니다.

예제 코드

Sub ChangeFontColors()
    Range("A1").Font.Color = rgbBlue
    Range("A2").Font.Color = rgbCrimson
    Range("A3").Font.Color = rgbDarkOrange
    Range("A4").Font.Color = rgbIndigo
End Sub

Sub ChangeCellColors()
    Range("A1").Interior.Color = rgbGreen
    Range("A2").Interior.Color = rgbCrimson
    Range("A3").Interior.Color = rgbLemonChiffon
    Range("A4").Interior.Color = rgbRoyalBlue
End Sub