Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ron Rosenfeld
 
Posts: n/a
Default Formatting from a Function

You're welcome. Glad to help.

On Mon, 2 Jan 2006 14:52:13 +0100, "VALid" wrote:


Oh... Trivial!
Thanks a lot, I'll correct that way.

"Ron Rosenfeld" a écrit dans le message de news:
...
On Mon, 2 Jan 2006 14:34:04 +0100, "VALid" wrote:


Hi,

I wrote that very simple function.... which does NOT work.
Any idea why??? Thanks.

Public Function SetCellColor(ByVal AnIndex As Long)
'Application.Volatile (True)
With Selection.Interior
.ColorIndex = AnIndex
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
End With
SetCellColor = AnIndex
End Function



A function can only return a value.

You need to formulate a Sub in order to affect a cell's appearance.


--ron




--ron
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
Conditionial formatting for merged cells, function Len($A$4) CajunWebfoot Excel Worksheet Functions 1 July 28th 05 04:42 PM
Automatically up date time in a cell Mark Excel Discussion (Misc queries) 5 May 12th 05 12:26 AM
difficulty with conditional formatting Deb Excel Discussion (Misc queries) 0 March 23rd 05 06:13 PM
Conversion SVC Excel Worksheet Functions 9 February 28th 05 02:29 PM
How can I use an IF function to look for specific cell formatting. Tim Excel Worksheet Functions 1 November 15th 04 01:09 PM


All times are GMT +1. The time now is 03:48 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"