To use standard colors: vbBlack, vbRed, vbGreen, vbYellow, vbBlue, vbMagenta, vbCyan, or vbWhite : Color Constant « Application « VBA / Excel / Access / Word






To use standard colors: vbBlack, vbRed, vbGreen, vbYellow, vbBlue, vbMagenta, vbCyan, or vbWhite

 
Sub colorYellow()
    range("A1").Interior.color = vbYellow
End Sub

 








Related examples in the same category

1.VBA-Defined Constants: vbBlack
2.VBA-Defined Constants: vbBlue
3.VBA-Defined Constants: vbCyan
4.VBA-Defined Constants: vbGreen
5.VBA-Defined Constants: vbMagenta
6.VBA-Defined Constants: vbRed
7.VBA-Defined Constants: vbWhite
8.VBA-Defined Constants: vbYellow