ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel 2000 = upgraded to 2003 and macro to change font color fail (https://www.excelbanter.com/excel-programming/341890-excel-2000-%3D-upgraded-2003-macro-change-font-color-fail.html)

Donna

Excel 2000 = upgraded to 2003 and macro to change font color fail
 
I have a spreadsheet with two macros that change the font color on a
specified cell in a protected worksheet based on some conditions. This macro
worked fine in Office 2000 but now that I've upgraded to 2003 the macro fails
at the Selection statement:

Range("C9").Select
Selection.Font.ColorIndex = 3

Has the VB changed between releases? Is there a work around for this?

Thanks
Donna L Bruce

Donna L Bruce

Excel 2000 = upgraded to 2003 and macro to change font color fail
 
----Additional information----

The error message I get is:
"Unable to set the ColorIndex property of the Font class."

--
Donna L Bruce
Sr Technical Writer
Elster Electricity, LLC
Raleigh NC


"Donna" wrote:

I have a spreadsheet with two macros that change the font color on a
specified cell in a protected worksheet based on some conditions. This macro
worked fine in Office 2000 but now that I've upgraded to 2003 the macro fails
at the Selection statement:

Range("C9").Select
Selection.Font.ColorIndex = 3

Has the VB changed between releases? Is there a work around for this?

Thanks
Donna L Bruce


Simon Murphy

Excel 2000 = upgraded to 2003 and macro to change font color fail
 
Donna
Vb hasn't changed much, but sheet protection has, in 2003 you can prevent
cell selection
try
Range("C9").Font.ColorIndex = 3

and also check out what is protected, there are a few more options in 2003.
also consider protecting the user interface only if you are also wanting to
change things in code

cheers
Simon

"Donna" wrote in message
...
I have a spreadsheet with two macros that change the font color on a
specified cell in a protected worksheet based on some conditions. This
macro
worked fine in Office 2000 but now that I've upgraded to 2003 the macro
fails
at the Selection statement:

Range("C9").Select
Selection.Font.ColorIndex = 3

Has the VB changed between releases? Is there a work around for this?

Thanks
Donna L Bruce




Donna L Bruce

Excel 2000 = upgraded to 2003 and macro to change font color
 
Tried the following:

Range("C9").Font.ColorIndex = 3

and got the same message Unable to set the ColorIndex property . . .

--
Donna L Bruce
Sr Technical Writer
Elster Electricity, LLC
Raleigh NC


"Simon Murphy" wrote:

Donna
Vb hasn't changed much, but sheet protection has, in 2003 you can prevent
cell selection
try
Range("C9").Font.ColorIndex = 3

and also check out what is protected, there are a few more options in 2003.
also consider protecting the user interface only if you are also wanting to
change things in code

cheers
Simon

"Donna" wrote in message
...
I have a spreadsheet with two macros that change the font color on a
specified cell in a protected worksheet based on some conditions. This
macro
worked fine in Office 2000 but now that I've upgraded to 2003 the macro
fails
at the Selection statement:

Range("C9").Select
Selection.Font.ColorIndex = 3

Has the VB changed between releases? Is there a work around for this?

Thanks
Donna L Bruce





Donna L Bruce

Excel 2000 = upgraded to 2003 and macro to change font color
 
Finally got it to work.
I had to check to allow users to change cell formats in worksheet protection.

--
Donna L Bruce
Sr Technical Writer
Elster Electricity, LLC
Raleigh NC


"Donna L Bruce" wrote:

Tried the following:

Range("C9").Font.ColorIndex = 3

and got the same message Unable to set the ColorIndex property . . .

--
Donna L Bruce
Sr Technical Writer
Elster Electricity, LLC
Raleigh NC


"Simon Murphy" wrote:

Donna
Vb hasn't changed much, but sheet protection has, in 2003 you can prevent
cell selection
try
Range("C9").Font.ColorIndex = 3

and also check out what is protected, there are a few more options in 2003.
also consider protecting the user interface only if you are also wanting to
change things in code

cheers
Simon

"Donna" wrote in message
...
I have a spreadsheet with two macros that change the font color on a
specified cell in a protected worksheet based on some conditions. This
macro
worked fine in Office 2000 but now that I've upgraded to 2003 the macro
fails
at the Selection statement:

Range("C9").Select
Selection.Font.ColorIndex = 3

Has the VB changed between releases? Is there a work around for this?

Thanks
Donna L Bruce






All times are GMT +1. The time now is 05:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com