Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to change font color in Excel 2003 VBA

Status
Not open for further replies.

DKDiveDude

IS-IT--Management
Mar 9, 2003
24
US
The following VBA line worked swell in Excel 2000.

ActiveSheet.Range("Alert").Cells.Font.Color = RGB(255, 0, 0)

The company I work for was FORCED to upgrade to Office 2003, because the new Microsoft Exchange Server required that version. I am 100% sure Micro$oft could have programmed this new Exchange Server, without this requirement, but tweaking it a certain way they made it so they forced companies to upgrade. I really, really, really hate Micro$soft!

Anyways, after the Office 2003, I now I get a Run-time error '1004':

Unable to set the Color property of the Font class

I have two questions:

1) Was the above VBA code not properly formatted, I mean stupid code, or is it Micro$oft who just can't make an upgrade that is 100% backward compatible?

2) Looking a bit in the VBA help file I noticed ColorIndex, but after changing my code I still get the same error:

ActiveSheet.Range("Alert").Cells.Font.ColorIndex = 3


Can somebody please help me out, thanks
 
It works on 2003

Do you REALLY have a range named Alert on the active sheet???

Skip,

[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue]
 
Actually now I am not 100% sure it can be called a range, but I do have a cell named "Alert".

It is a cell where I display messages to users, dependent on their input.

And like I said it worked swell in Excel 2000.
 
well bill has it werkin swell in 2003.

As long as you have a Range Named Alert, on the ActiveSheet, it should work. Be ABSOLUTELY SURE that the range name is in Insert/Name/Define.



Skip,

[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue]
 
I just double checked the range "Alert" is defined in "Insert/Name/Define".

My sheet is protected, so I had to unprotect the sheet to view this information that way.
 
Ahhhaaaaaaaaaa!

My sheet is protected...

Skip,

[glasses] [red]Be advised:[/red] When transmitting sheet music...
If it ain't baroque, don't fax it! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top