Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gilles P (FR)
 
Posts: n/a
Default Change Cell properties by Function

Hello,

I like to change the colorIndex of a cell by a function is it possible ?
The code following doesn't works:

Function Fncolor(Value)
Worksheets("Sheet").Cells(RowNbr, ColumnNbr).Font.ColorIndex = 3
Fncouleur = "nnnnnn"
End Function

With a cell containing '=Fncolor(5)' to call the function

The goal is to avoid Format / condition limitation to 3 conditions....
Thanks for your Help

Gilles P(FR)


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gary''s Student
 
Posts: n/a
Default Change Cell properties by Function

The colorindex can not be changed by a function alone. You would need an
event macro to operate in conjunction with the function.
--
Gary's Student


"Gilles P (FR)" wrote:

Hello,

I like to change the colorIndex of a cell by a function is it possible ?
The code following doesn't works:

Function Fncolor(Value)
Worksheets("Sheet").Cells(RowNbr, ColumnNbr).Font.ColorIndex = 3
Fncouleur = "nnnnnn"
End Function

With a cell containing '=Fncolor(5)' to call the function

The goal is to avoid Format / condition limitation to 3 conditions....
Thanks for your Help

Gilles P(FR)


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Gilles P (FR)
 
Posts: n/a
Default Change Cell properties by Function

So, to skip it i use these events to call the procedure

Sub Worksheet_Change(ByVal Target As Range)
macro Target 'Call a procedure to change
colorindex
End Sub
or
Sub Worksheet_SelectionChange (ByVal Target As Range)
macro Target 'Call a procedure to change
colorindex
End Sub


Is there no any other way ?
because the code will run on each change in worksheet.

Nota: To call an other procedure from function doesn't works too !!

Gilles P (FR)


"Gary''s Student" a écrit :

The colorindex can not be changed by a function alone. You would need an
event macro to operate in conjunction with the function.
--
Gary's Student


"Gilles P (FR)" wrote:

Hello,

I like to change the colorIndex of a cell by a function is it possible ?
The code following doesn't works:

Function Fncolor(Value)
Worksheets("Sheet").Cells(RowNbr, ColumnNbr).Font.ColorIndex = 3
Fncouleur = "nnnnnn"
End Function

With a cell containing '=Fncolor(5)' to call the function

The goal is to avoid Format / condition limitation to 3 conditions....
Thanks for your Help

Gilles P(FR)


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
I Need a formula to evaluate a cell with + or - values Bob in Oklahoma Excel Worksheet Functions 6 October 31st 05 02:41 PM
use if function to change cell color bigdaddy3 Excel Worksheet Functions 2 September 16th 05 11:36 AM
copying the function contained within a cell to anouther cell. DMB Excel Worksheet Functions 2 September 1st 05 05:49 PM
SQL - Auto Refresh Upon Cell Value Change Elliot J Excel Worksheet Functions 1 May 12th 05 10:22 AM
GET.CELL Biff Excel Worksheet Functions 2 November 24th 04 07:16 PM


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