Sub Hexagon1_Click()
Dim shp As Shape
Dim shpName
Dim Color
shpName = Application.Caller
Set shp = ActiveSheet.Shapes(shpName)
Color = Range("Color").Value
shp.Fill.ForeColor.RGB = Color
End Sub
Sub Hexagon1_Test()
Dim shp As Shape
Dim shpName
Dim Color
shpName = "Hexagon 1"
Set shp = ActiveSheet.Shapes(shpName)
Color = shp.Fill.ForeColor.RGB
Range("Color").Value = Color
End Sub
Thanks. I've seen that, however. I'm looking specifically for a chart that lists the other colors like -16776961 ...which in this case is red. That's the only one I have.
Is that from an Apple Macintosh by chance?Could this help?
View attachment 57590
Sub Demo()
Dim ar
ar = Array(vbBlack, vbRed, vbGreen, vbYellow, vbBlue, vbMagenta, vbCyan, vbWhite)
For i = LBound(ar) To UBound(ar)
Cells(i + 1, "A").Interior.Color = ar(i)
Cells(i + 1, "B").Value = Cells(i + 1, "A").Interior.ColorIndex
Next
End Sub
My "More colors" looks like these two pictures:Eloise T
Who knows is that only from Apple?
Have You tried to select eg background color with any Excel?
> For me, there is 'More colors...' and
after that there are many possibilities to work with those.
Where have You find that -16776961 is as RBG(255,0,0)?
Interesting that the -16776961 turns out to be decimal equivalent to FFFF0000FF. That number is making more sense...not completely, but more.This is not a chart but it allows you to input a hex number and apply it to a shape or the reverse (the original shape colours were washed out because they were set to 50% transparency)
I have now learned that -16776961 was converted from HEX FFFF0000FF.Eloise T
Who knows is that only from Apple?
Have You tried to select eg background color with any Excel?
> For me, there is 'More colors...' and
after that there are many possibilities to work with those.
Where have You find that -16776961 is as RBG(255,0,0)?
...and I'll keep hunting until I find a good answer.Eloise T
Your 'Custom' is as same as mine only Hex-value is missing.
Red ~ RGB(255,0,0) ~ #FF0000
FFFF0000FF .. hmm? but with which rule?
I believe the highlight should be applied to the final six characters.FFFF0000FF .. hmm? but with which rule?
I agree.vletm
Agreeing most of the way but I think you have highlighted the wrong part of the hex string.
I believe the highlight should be applied to the final six characters.
FFFF 00 00 FF
The final (least significant) two control red, the next two control green and the most significant control blue. What I do not know is the significance to the first four characters (16 bits). It seems that filling the sequence with 0 or 1 is OK and gives the same colour but other values crash VBA.
Sub ColorCells()
Dim c As Range
For Each c In [Decimal]
c.Offset(0, 1).Interior.Color = c.Value
Next c
End Sub