VBA/Excel/Access/Word/Application/Color Constant
Содержание
- 1 To use standard colors: vbBlack, vbRed, vbGreen, vbYellow, vbBlue, vbMagenta, vbCyan, or vbWhite
- 2 VBA-Defined Constants: vbBlack
- 3 VBA-Defined Constants: vbBlue
- 4 VBA-Defined Constants: vbCyan
- 5 VBA-Defined Constants: vbGreen
- 6 VBA-Defined Constants: vbMagenta
- 7 VBA-Defined Constants: vbRed
- 8 VBA-Defined Constants: vbWhite
- 9 VBA-Defined Constants: vbYellow
To use standard colors: vbBlack, vbRed, vbGreen, vbYellow, vbBlue, vbMagenta, vbCyan, or vbWhite
Sub colorYellow()
range("A1").Interior.color = vbYellow
End Sub
VBA-Defined Constants: vbBlack
Sub obj2()
Dim myObject As Range
Set myObject = Range("A1:B10")
myObject.Interior.Color = vbBlack
End Sub
VBA-Defined Constants: vbBlue
Sub obj3()
Dim myObject As Range
Set myObject = Range("A1:B10")
myObject.Interior.Color = vbBlue
End Sub
VBA-Defined Constants: vbCyan
Sub obj4()
Dim myObject As Range
Set myObject = Range("A1:B10")
myObject.Interior.Color = vbCyan
End Sub
VBA-Defined Constants: vbGreen
Sub obj5()
Dim myObject As Range
Set myObject = Range("A1:B10")
myObject.Interior.Color = vbGreen
End Sub
VBA-Defined Constants: vbMagenta
Sub obj6()
Dim myObject As Range
Set myObject = Range("A1:B10")
myObject.Interior.Color = vbMagenta
End Sub
VBA-Defined Constants: vbRed
Sub obj7()
Dim myObject As Range
Set myObject = Range("A1:B10")
myObject.Interior.Color = vbRed
End Sub
VBA-Defined Constants: vbWhite
Sub obj8()
Dim myObject As Range
Set myObject = Range("A1:B10")
myObject.Interior.Color = vbWhite
End Sub
VBA-Defined Constants: vbYellow
Sub obj9()
Dim myObject As Range
Set myObject = Range("A1:B10")
myObject.Interior.Color = vbYellow
End Sub