Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default custom function color

Hello:

I would like to make a custon funtion that will make the color of the cell
one number different then the selected range. Lets say the formula will work
something like this in cell b1: =MyColor(A1) and if the RGB color in cell a1
is red 10 green 0 yellow 0 then cell b1 should be red 11 green 0 yellow 0.

Please help.

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default custom function color


The function can only pass a value back to the worksheet or to a sub,
the function itself cannot create the colour.


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30227

  #3   Report Post  
Posted to microsoft.public.excel.programming
Art Art is offline
external usenet poster
 
Posts: 587
Default custom function color

So how about a vba modul that will change the colors of the selected cells to
one diffedrent rgb color by a scroll bar? Like range a1:E50 which all contain
certain colors in each cell, by scrolling the scroll bar will change the
color from each to a diiferent color like a1 is r = 10 g = 0 y = 0 then r=11
g=0 y=0.



"The Code Cage Team" wrote:


The function can only pass a value back to the worksheet or to a sub,
the function itself cannot create the colour.


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30227


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default custom function color


Here's some basic code you can adapt for your specific needs:

Sub IncrementColors()
Dim R As Range
Dim C As Long
For Each R In Range("A1:A5")
If R.Interior.ColorIndex 0 Then
C = (R.Interior.ColorIndex + 1) Mod 57
R.Interior.ColorIndex = C
End If
Next R
End Sub


This changes the background fill color "up" one value in the built-in
color pallet, "rolling over" from 56 back to 1. R.Interior.ColorIndex
changes the background fill. Use R.Font.ColorIndex to change font
color.

The code only changes that have a specific color assigned to them.
(ColorIndex 0). It doesn't change the default background or font
color (ColorIndex < 0).

See http://www.cpearson.com/Excel/Colors.aspx for lots more info on
working with colors.

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Sun, 16 Nov 2008 08:53:01 -0800, art
wrote:

So how about a vba modul that will change the colors of the selected cells to
one diffedrent rgb color by a scroll bar? Like range a1:E50 which all contain
certain colors in each cell, by scrolling the scroll bar will change the
color from each to a diiferent color like a1 is r = 10 g = 0 y = 0 then r=11
g=0 y=0.



"The Code Cage Team" wrote:


The function can only pass a value back to the worksheet or to a sub,
the function itself cannot create the colour.


--
The Code Cage Team

Regards,
The Code Cage Team
http://www.thecodecage.com
------------------------------------------------------------------------
The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=30227


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
Error when adding custom help file to custom function Sabotuer99 Excel Programming 1 July 19th 08 01:46 PM
Creating a custom function to interpret another custom engine func Ryan Excel Programming 0 March 3rd 08 07:18 PM
Custom Color/Color Index FARAZ QURESHI Excel Discussion (Misc queries) 4 February 29th 08 05:19 PM
Powerpoint / Excel: custom pp RGB color doesn't match identical Excelcustom RGB color mikewillnot Charts and Charting in Excel 1 February 26th 08 05:22 PM
Add-in - add a custom function to a custom group. Spencer Hutton Excel Programming 1 December 4th 07 02:53 PM


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