Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1525
  • Last Modified:

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

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
Tocogroup
Asked:
Tocogroup
1 Solution
 
Rgonzo1971Commented:
Hi,

pls try

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

Open in new window

Regards
0
 
TocogroupAuthor Commented:
Many thanks for that.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now