Solved

How do I change the text colour in an Excel combo box with VBA ?

Posted on 2014-02-08
2
1,171 Views
Last Modified: 2014-02-08
Hi All,

I have a combo box on my Excel User form (called coCategory) and, depending on the value in another form field (coStatus), I want to change the colour of the text.

Here's my current code which doesn't work !!

   If Me.Controls("coStatus").Value <> "Completed" Then
      coCategory.Font.Color = vbRed
   End If

What do I need to correct to get it to work ?

Thanks
Toco
0
Comment
Question by:Tocogroup
2 Comments
 
LVL 49

Accepted Solution

by:
Rgonzo1971 earned 500 total points
ID: 39843955
Hi,

pls try

   If Me.Controls("coStatus").Value <> "Completed" Then
      coCategory.ForeColor = vbRed
   End If

Open in new window

Regards
0
 

Author Closing Comment

by:Tocogroup
ID: 39843974
Many thanks for that.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Lync meeting or Lync conferencing is what many organizations would like to deploy to allow them save money. But companies are now giving up for various reasons, one of which is that they cannot join external meetings (non-federated company meetings)…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

810 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