Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Cell will not format with a color

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?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Cell will not format with a color

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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 186
Default Cell will not format with a color

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
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
Can't format cell color/text color in Office Excel 2003 in fil Tony S Excel Discussion (Misc queries) 1 December 21st 07 01:41 PM
word match in string text in cell, color format cell jpmahony Excel Discussion (Misc queries) 1 October 31st 07 03:56 PM
Format cell color based on multiple cell values Zenaida Excel Discussion (Misc queries) 1 May 10th 06 07:31 PM
Format cell color based on multiple cell values Zenaida Excel Discussion (Misc queries) 3 May 9th 06 11:56 PM
Can't format cell color/text color in Office Excel 2003 in files . albertaman Excel Discussion (Misc queries) 0 February 16th 06 03:56 AM


All times are GMT +1. The time now is 07:35 AM.

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

About Us

"It's about Microsoft Excel"