Angeblich kann man über den VB-Editor Functionen erstellen, mit denen das geht Ich habe es schon mit folgendem VBA-Script probiert: Function ColorIndex(rng. 1 › vba › colorindex-codeliste-rgb-farben. 2 Statt der ColorIndex-Eigenschaft von Excel/VBA können Sie auch die Color-Eigenschaft verwenden. Die Color-Eigenschaft akzeptiert zwei Eingabetypen: vbColor; RGB. 3 Excel bietet standardmäßig 56 Farben an, die in einer Palette zusammengefasst sind. Diese werden in VBA über die Eigenschaft ColorIndex. 4 This example sets the color of the major gridlines for the value axis. VB With (xlValue) orGridlines Then 'Set color to ndex = 5 End If End With This example sets the color of the chart area interior to red, and sets the border color to blue. VB. 5 Angeblich kann man über den VB-Editor Functionen erstellen, mit denen das geht Ich habe es schon mit folgendem VBA-Script probiert: Function ColorIndex(rng As Selection) Dim iColor As Long iColor = ndex ColorIndex = Str(iColor) End Function. 6 To check if every cell in this range has the same ColorIndex I loop through them. Every cell has ColorIndex=1. However whole range does not it seems - because it returns FALSE. This occures only if I change color of cells with VBA, when I do it matually everything runs just fine. 7 I'm trying to set a public const of a color in my VBA code. Normally, I can use: Dim BLUE As Long BLUE = RGB (, , ) However, there's no way to public const that because of the RGB function. I converted this RGB value to Hex using an online converter, and I got back B7DEE8 Using: BLUE = &HB7DEE8 results in a completely different color. 8 VB Color is the easiest way to set colors in VBA. However, it’s also the least flexible. To set a color code using vbColor use the table below: However, as you can see from the table, your options are extremely limited. Set Cell Background Color Range ("A1") = vbYellow Set Cell Font Color Range ("A1") = vbBlue. 9 Excel VBA – Alle Farbindizes (ColorIndex) auflisten Dieser Beitrag ist ein Teil der VBA Grundlagen Serie. Excel bietet standardmäßig 56 Farben an, die in einer Palette zusammengefasst sind. Diese werden in VBA über die Eigenschaft ColorIndex angesprochen. In diesem Beitrag zeige ich Ihnen, wie Sie alle Indizes auf einen Blick auflisten können. vba colorindex rgb 10 vba colorindex tabelle 12