LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Set cell color with VBA results in "#VALUE!"

Hello

I made a function in a new module with a function which looks like this:

Public Function testColor()

MsgBox Cells(1, 1).Interior.Color 'does work - displays e.g. 255
Cells(1, 1).Interior.Color = 10 'does NOT work - displays "#VALUE!"
in the calling cell

End Function

This function gets called in a cell ("=testColor()").
The target would be to change the color of a cell with this VBA function.
Sadly setting the color does not work, while I can perfectly read the
color-code.

Where's the mistake here? I'm using Excel 2007.
 
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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Different Font Color for results evaluated by "IF" exceltyro New Users to Excel 2 April 9th 07 05:38 PM
set "value if true" to "fill cell with color" Feeta Excel Programming 4 July 23rd 05 08:16 AM
Using the results of CELL function ("address" info type) Frank Kabel Excel Programming 0 September 7th 04 07:38 PM
How can I make cell A1 a "Y" or "N" depending upon cell A2's font color? Please help. [email protected] Excel Programming 1 October 16th 03 08:32 PM


All times are GMT +1. The time now is 01:42 PM.

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"