VBA/Excel/Access/Word/Application/Color Constant

Материал из VB Эксперт
Перейти к: навигация, поиск

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