Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default unable to set the colorindex property of the font class

re the code below, the code will only execute if called
from a form when the spreadsheet is loading. If I call the
code from a button on the sheet itself I obtain an error -

"unable to set the colorindex property of the font class"

I would love an explanation of the problems with the code

Steve

Sub Reveal_Cells(Rng As Range, Default_Value As Variant)
Rng.Interior.ColorIndex = 19
Rng.Font.ColorIndex = 5
Rng.Value = Default_Value
End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default unable to set the colorindex property of the font class

works fine for me. Are you passing a range & value? Is
the cell/sheet protected?

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
re the code below, the code will only execute if called
from a form when the spreadsheet is loading. If I call

the
code from a button on the sheet itself I obtain an

error -

"unable to set the colorindex property of the font class"

I would love an explanation of the problems with the code

Steve

Sub Reveal_Cells(Rng As Range, Default_Value As Variant)
Rng.Interior.ColorIndex = 19
Rng.Font.ColorIndex = 5
Rng.Value = Default_Value
End Sub
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 141
Default unable to set the colorindex property of the font class


Yes I pass in a range + value. The worksheet is not
protected. What is odd is that the line

Rng.Value = Default_Value

Will work fine if the others are commented out, all the
others to do with colors etc cause exceptions if run at
any time other than startup.

I should mention I am using excel 97

thanks

Steve

-----Original Message-----
works fine for me. Are you passing a range & value? Is
the cell/sheet protected?

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
re the code below, the code will only execute if called
from a form when the spreadsheet is loading. If I call

the
code from a button on the sheet itself I obtain an

error -

"unable to set the colorindex property of the font class"

I would love an explanation of the problems with the code

Steve

Sub Reveal_Cells(Rng As Range, Default_Value As Variant)
Rng.Interior.ColorIndex = 19
Rng.Font.ColorIndex = 5
Rng.Value = Default_Value
End Sub
.

.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default unable to set the colorindex property of the font class

is the procedure on a userform's code?
make sure the form is loaded by the button

Patrick
-----Original Message-----

Yes I pass in a range + value. The worksheet is not
protected. What is odd is that the line

Rng.Value = Default_Value

Will work fine if the others are commented out, all the
others to do with colors etc cause exceptions if run at
any time other than startup.

I should mention I am using excel 97

thanks

Steve

-----Original Message-----
works fine for me. Are you passing a range & value? Is
the cell/sheet protected?

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
re the code below, the code will only execute if

called
from a form when the spreadsheet is loading. If I call

the
code from a button on the sheet itself I obtain an

error -

"unable to set the colorindex property of the font

class"

I would love an explanation of the problems with the

code

Steve

Sub Reveal_Cells(Rng As Range, Default_Value As

Variant)
Rng.Interior.ColorIndex = 19
Rng.Font.ColorIndex = 5
Rng.Value = Default_Value
End Sub
.

.

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
unable to set the values property of the series class BHatMJ Excel Discussion (Misc queries) 4 July 10th 09 03:46 PM
Unable to set the XValues property of the Series class ramkumar_cpt Charts and Charting in Excel 5 November 29th 05 02:13 PM
Unable to set Bold property of the Font Class Mike Lee Excel Programming 2 January 19th 04 06:23 PM
Unable to set the colorIndex Property of the Interior Class Error GriffyGriff Excel Programming 3 October 3rd 03 04:37 PM
Unable to set the Locked Property of the Range Class Stuart[_5_] Excel Programming 0 July 15th 03 06:59 PM


All times are GMT +1. The time now is 06:33 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"