?
Solved

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

Posted on 2014-03-10
2
Medium Priority
?
641 Views
Last Modified: 2014-03-10
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
0
Comment
Question by:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 2000 total points
ID: 39918784
[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
 

Author Closing Comment

by:Murray Brown
ID: 39918832
Thanks very much
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question