Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Cell will not format with a color

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jack - 31 May 2008 17:13 GMT
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 - 31 May 2008 17:30 GMT
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.

> 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
[quoted text clipped - 19 lines]
>
> Is there something that I need to set somewhere?

Signature

Dave Peterson

jack - 31 May 2008 18:36 GMT
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.

> Are you calling this function from a cell in a worksheet?
>
[quoted text clipped - 24 lines]
> >
> > Is there something that I need to set somewhere?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.