PC Review


Reply
Thread Tools Rate Thread

Cell will not format with a color

 
 
jack
Guest
Posts: n/a
 
      31st May 2008
I have a function in which I can calculate the result differently based on
some input parameters. I would like to visually know which calculation path
I am selecting by setting different background colors. I see the examples
and have checked through these postings but I cannot change the background
color of the cell. I have moved the sheet off to its own xls file and
totally simplified the code:

Function Test1()
Sheets("Sheet1").Range("A1").Interior.ColorIndex = 4
Test1 = 6
End Function

The Test1 = 6 is just so I can verify that the function is being executed by
changing the 6 to other numbers.

I have tried:
ActiveCell.Interior.ColorIndex
RGB color settings
Selecting a Range and setting it

I have Protected the sheet and set AllowFormatting

Is there something that I need to set somewhere?


 
Reply With Quote
 
 
 
 
Dave Peterson
Guest
Posts: n/a
 
      31st May 2008
Are you calling this function from a cell in a worksheet?

If yes, then that's the way excel works--UDF's return values to the cell. They
don't change formatting.

jack wrote:
>
> I have a function in which I can calculate the result differently based on
> some input parameters. I would like to visually know which calculation path
> I am selecting by setting different background colors. I see the examples
> and have checked through these postings but I cannot change the background
> color of the cell. I have moved the sheet off to its own xls file and
> totally simplified the code:
>
> Function Test1()
> Sheets("Sheet1").Range("A1").Interior.ColorIndex = 4
> Test1 = 6
> End Function
>
> The Test1 = 6 is just so I can verify that the function is being executed by
> changing the 6 to other numbers.
>
> I have tried:
> ActiveCell.Interior.ColorIndex
> RGB color settings
> Selecting a Range and setting it
>
> I have Protected the sheet and set AllowFormatting
>
> Is there something that I need to set somewhere?


--

Dave Peterson
 
Reply With Quote
 
jack
Guest
Posts: n/a
 
      31st May 2008
Wonder where that would be stated? Now that you say so, I remember doing
something before that I had to put on a control button. That is not what I
need here. Thanks for your help Dave.


"Dave Peterson" wrote:

> Are you calling this function from a cell in a worksheet?
>
> If yes, then that's the way excel works--UDF's return values to the cell. They
> don't change formatting.
>
> jack wrote:
> >
> > I have a function in which I can calculate the result differently based on
> > some input parameters. I would like to visually know which calculation path
> > I am selecting by setting different background colors. I see the examples
> > and have checked through these postings but I cannot change the background
> > color of the cell. I have moved the sheet off to its own xls file and
> > totally simplified the code:
> >
> > Function Test1()
> > Sheets("Sheet1").Range("A1").Interior.ColorIndex = 4
> > Test1 = 6
> > End Function
> >
> > The Test1 = 6 is just so I can verify that the function is being executed by
> > changing the 6 to other numbers.
> >
> > I have tried:
> > ActiveCell.Interior.ColorIndex
> > RGB color settings
> > Selecting a Range and setting it
> >
> > I have Protected the sheet and set AllowFormatting
> >
> > Is there something that I need to set somewhere?

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Can't format cell color/text color in Office Excel 2003 in files . Gord Dibben Microsoft Excel Misc 4 21st Dec 2007 01:41 PM
word match in string text in cell, color format cell =?Utf-8?B?anBtYWhvbnk=?= Microsoft Excel Misc 1 31st Oct 2007 03:56 PM
RE: Can't format cell color/text color in Office Excel 2003 in files . =?Utf-8?B?YWxiZXJ0YW1hbg==?= Microsoft Excel Misc 0 16th Feb 2006 03:56 AM
RE: Can't format cell color/text color in Office Excel 2003 in files . =?Utf-8?B?QnJpbnNsZXk=?= Microsoft Excel Misc 0 16th Sep 2004 09:15 PM
Can't format cell color/text color in Office Excel 2003 in files . =?Utf-8?B?Q2hhcmxpZQ==?= Microsoft Excel Misc 0 16th Sep 2004 04:29 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:52 AM.