Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default need codeto view the 56 colors of ColorIndex


Help with this please

I trying to write for a buton the will change a cell color
each press will increment the ColorIndex property.

Also a question ...does the ColorIndex # relate directly to the colo

pallet used when changing a cell color manually?
They dont seem to correspond.

Thank you for the hel

--
SuitedAce
-----------------------------------------------------------------------
SuitedAces's Profile: http://www.excelforum.com/member.php...fo&userid=3584
View this thread: http://www.excelforum.com/showthread.php?threadid=55718

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default need codeto view the 56 colors of ColorIndex


Hello SuitedAces,

The pallet is arranged by color not by color index values.

Here is a macro that will change the active cell's background color
according to the color index sequentially. It places the color index in
the cell to the right. You can comment this line out if you like.


Code:
--------------------

Sub ChangeColor()

Dim N As Integer
Static CI As Integer

CI = CI + 1
With ActiveCell
N = CI Mod 57
.Interior.ColorIndex = N
.Offset(0, 1).Value = N
End With

End Sub

--------------------


Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=557183

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default need codeto view the 56 colors of ColorIndex


Thank you very much.

I am a beginner and struggling with using variables for looping
and trying to figure out where I need to declare the variables.

This will help clue me in

--
SuitedAce
-----------------------------------------------------------------------
SuitedAces's Profile: http://www.excelforum.com/member.php...fo&userid=3584
View this thread: http://www.excelforum.com/showthread.php?threadid=55718

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
Workbook View / Appearance - Colors Teddy-B Excel Discussion (Misc queries) 1 August 30th 07 03:46 PM
Why can I only view colors in Excel when I print preview? lmac Excel Discussion (Misc queries) 1 December 27th 06 11:08 PM
view colors in open worksheet jjsouther Excel Discussion (Misc queries) 5 November 16th 06 07:41 PM
What are the values for ColorIndex 's 56 colors ? i.e. green=3 . RandyDtg1[_2_] Excel Programming 9 April 13th 05 08:08 PM
WHere can I find a list of ColorIndex colors? Christiane[_12_] Excel Programming 3 April 28th 04 04:12 PM


All times are GMT +1. The time now is 09:51 PM.

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"