Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determining background color of cell, in &H0080FFFF& format?
I'm finding that the palette of the controls on the Control toolbar is not
the same as the background colors for workbook cells. How can I find the background color of a cell in the &H0080FFFF& format? Then I can, of course, simply enter that number in the control's property. Don <donwiss at panix.com. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determining background color of cell, in &H0080FFFF& format?
Instead of using .ColorIndex use only .Color
Though this will not return in the exact format you asked for, it will return the colour independent of the pallete. Try:- Dim myColor as Long myColor = Worksheets("Sheet1").Range("A5").Interior.Color MsgBox myColor Sharad *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Determining background color of cell, in &H0080FFFF& format?
Don
Here´s one way: Select the cell in question and run the below sub to get the interior color of the cell in the format &H00BBGGRR& Sub HexColor() 'Leo Heuser, 25-12-2004 Dim ColorRange As Range Dim Red As Integer, Green As Integer, Blue As Integer Set ColorRange = Selection Red = ColorRange.Interior.Color And &HFF Green = (ColorRange.Interior.Color And CLng(&HFF) * &H100) / &H100 Blue = (ColorRange.Interior.Color And CLng(&HFF) * &H10000) / &H10000 MsgBox "&H00" & _ String(2 - Len(Hex(Blue)), "0") & Hex(Blue) & _ String(2 - Len(Hex(Green)), "0") & Hex(Green) & _ String(2 - Len(Hex(Red)), "0") & Hex(Red) & _ "&" End Sub -- Best Regards Leo Heuser Followup to newsgroup only please. "Don Wiss" skrev i en meddelelse ... I'm finding that the palette of the controls on the Control toolbar is not the same as the background colors for workbook cells. How can I find the background color of a cell in the &H0080FFFF& format? Then I can, of course, simply enter that number in the control's property. Don <donwiss at panix.com. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to count cells with specific format (background color)? | Excel Discussion (Misc queries) | |||
Format Background Color Teaser | Excel Discussion (Misc queries) | |||
Default Border, Font Color, and Cell Background Color | Excel Discussion (Misc queries) | |||
Sensing actual format background color | Excel Programming | |||
Determining active conditional format of one cell | Excel Programming |