Excel VBA/VB.net Gather information about cell fill color and font color

Hi

What Excel VBA code would I use to get the cell fill color and font color in an ARGB
color format so that I can use this information to format a text box on a windows form
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
nutschConnect With a Mentor Commented:
[A1].interior.color
and
[A1].font.color
will return a RGB value.

to get the different components:

Dim lColor As Long
lColor = Selection.Interior.Color

MsgBox "Red: " & lColor Mod 256 & vbCrLf & _
            "Green: " & Int(lColor / 256) Mod 256 & vbCrLf & _
            "Blue:" & Int(lColor / 256 ^ 2) Mod 256

Open in new window

0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.