colouring text vba

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

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

Colouring text with VBA

resolvedResolved · Low Priority · Version 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:

Percentage format

Ctrl+Shift+% applies the Percentage format, with no decimal places.

View all Excel hints and tips


Server loaded in 0.07 secs.