VBA - Excel - how to extract the default font color (2 Viewers)

essaytee

Need a good one-liner.
Local time
Tomorrow, 07:08
Joined
Oct 20, 2008
Messages
542
In Access VBA when creating Excel spreadsheets, how do I extract the default font color?

I have a routine where I cycle through a recordset and one particular field has one of three possible values, a positive number, zero or negative number, that are text fields, not numbers. (It's a leaderboard table and this field indicates the position move of the person from the previous leaderboard). I know how to set the color of the relevant cell, but I don't know how to refer to the default font color (other than not referring to it and obviously the default font color is set). For fields I'd rather set the color directly, after the color is determined, rather than continual if/else routines.

I'm setting the color like so:
Code:
Sheet1.Range(strRange).Font.Color = vbBlue

In my Googling, I did see references to Conditional formatting, and I'll certainly look at that afterwards, but at the moment I'd like to know how to directly refer to the default font color.
 
i think, the default color of a cel (range)
Code:
colorValue = Sheet1.Range(strRange).Interior.Color
 
According to what I have researched, there is a default THEME for which ALL of the colors in that theme's parts are defaults for whatever feature they represent in the theme. I'm not sure there is a singular answer to what you asked.
 
Thanks all for the responses. As usual, I overthink things. My executive decision is to simply refer to Black as my default colour, which it is anyway. I am the one creating the spreadsheet and then distributing it. It's not the case of me tinkering with somebody else's spreadsheet.
 

Users who are viewing this thread

Back
Top Bottom