Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

colouring text vba

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » Colouring text with VBA

Colouring text with VBA

ResolvedVersion 2003

Robert has attended:
Excel VBA Intro Intermediate course

Colouring text with VBA

In VBA, I have seen that "vbBlue" can be used to colour text Blue, but "vbPlum" didn't colour text Plum. Is there somewhere where a list of all the options for things like this can be found?
Thanx,
Rob.

RE: colouring text with VBA

Hi Robert,

Thank you for your question.

I have included a link below that outline all the VB constants:

http://msdn.microsoft.com/en-us/library/38cb0hb2 (VS.80).aspx

The other alternative is to use the RGB argument and enter the three values to create your required font colour.

Sub test()

With Range("a1")

.Font.Color = RGB(250, 206, 241)
.Font.Name = "Garamond"
.Font.Size = 18

End With

End Sub

I hope this helps.

Regards

Simon

Sun 4 Apr 2010: Automatically marked as resolved.

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

Add Text to Displayed Numbers in Excel 2010

To add text to a number in a cell, you need to go to the Home tab on the Ribbon, and click on the Cells group. Select Format Cells from the drop down menu then Custom from the Category list. In the Type box select General. After the word General, enter a space, then opening quotation marks, then the word you want to type and then closing quotation marks. Click on OK and you have your text!

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.