Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 178
Default cell fill color spectrum

I'm trying to make a sheet that shows all the possible cell fill
colors available in Excel. I'm using Excel 2002, SP3. The code I made
is as follows -

Sub colors()
Dim i As String
i = 1
a = 1
Do Until a = 65536
Rows(a).Interior.Color = i
i = i + 10
a = a + 1
Loop
End Sub

I switched the i loop to go up by 10 because I wasn't getting any good
variety in colors, only red black and maroon. Even after switching to
intervals of 10 I'm still only getting reds yellows and greens along
with blacks... I know there should be some blues and purples. Anyone
have any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 114
Default cell fill color spectrum

Cell interior colors in XL2002 are limited to one of the 56-color
palette options.
If you try to use a color not in the palette it will just get mapped
(not sure exactly how) to the nearest match.

Tim


On Jan 12, 12:38*pm, Matthew Dyer wrote:
I'm trying to make a sheet that shows all the possible cell fill
colors available in Excel. I'm using Excel 2002, SP3. The code I made
is as follows -

Sub colors()
Dim i As String
i = 1
a = 1
Do Until a = 65536
Rows(a).Interior.Color = i
i = i + 10
a = a + 1
Loop
End Sub

I switched the i loop to go up by 10 because I wasn't getting any good
variety in colors, only red black and maroon. Even after switching to
intervals of 10 I'm still only getting reds yellows and greens along
with blacks... I know there should be some blues and purples. Anyone
have any ideas?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 178
Default cell fill color spectrum

On Jan 12, 2:02*pm, Tim Williams wrote:
Cell interior colors in XL2002 are limited to one of the 56-color
palette options.
If you try to use a color not in the palette it will just get mapped
(not sure exactly how) to the nearest match.

Tim

On Jan 12, 12:38*pm, Matthew Dyer wrote:



I'm trying to make a sheet that shows all the possible cell fill
colors available in Excel. I'm using Excel 2002, SP3. The code I made
is as follows -


Sub colors()
Dim i As String
i = 1
a = 1
Do Until a = 65536
Rows(a).Interior.Color = i
i = i + 10
a = a + 1
Loop
End Sub


I switched the i loop to go up by 10 because I wasn't getting any good
variety in colors, only red black and maroon. Even after switching to
intervals of 10 I'm still only getting reds yellows and greens along
with blacks... I know there should be some blues and purples. Anyone
have any ideas?- Hide quoted text -


- Show quoted text -


make's sense. So is there a way to code it so I can get all of the 55
possible colors to fill a cell with? (assuming 56th value is no fill
at all)
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default cell fill color spectrum

Hi Matthew
I did not create these code, they come from the newsgroups, just don't remember
from were.

Sub Allcolor()
Dim c As Integer
Dim j As Integer
For c = 0 To 5
For j = 0 To 9
If c * 10 + j < 57 Then
Cells(c + 12, j + 2).Interior.ColorIndex = c * 10 + j
Cells(c + 12, j + 2).Value = c * 10 + j
End If
Next j
Next c
End Sub
HTH
John
"Matthew Dyer" wrote in message
...
On Jan 12, 2:02 pm, Tim Williams wrote:
Cell interior colors in XL2002 are limited to one of the 56-color
palette options.
If you try to use a color not in the palette it will just get mapped
(not sure exactly how) to the nearest match.

Tim

On Jan 12, 12:38 pm, Matthew Dyer wrote:



I'm trying to make a sheet that shows all the possible cell fill
colors available in Excel. I'm using Excel 2002, SP3. The code I made
is as follows -


Sub colors()
Dim i As String
i = 1
a = 1
Do Until a = 65536
Rows(a).Interior.Color = i
i = i + 10
a = a + 1
Loop
End Sub


I switched the i loop to go up by 10 because I wasn't getting any good
variety in colors, only red black and maroon. Even after switching to
intervals of 10 I'm still only getting reds yellows and greens along
with blacks... I know there should be some blues and purples. Anyone
have any ideas?- Hide quoted text -


- Show quoted text -


make's sense. So is there a way to code it so I can get all of the 55
possible colors to fill a cell with? (assuming 56th value is no fill
at all)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default cell fill color spectrum

I would just fill the cells in a column from 1 to 56... that way the row
number would be the ColorIndex number...

Sub AllColors()
Dim X As Long
For X = 1 To 56
Cells(X, "A").Interior.ColorIndex = X
Next
End Sub

To the OP.... assign the predefined color index constant xlNone for the "no
color" option.

--
Rick (MVP - Excel)


"John" wrote in message
...
Hi Matthew
I did not create these code, they come from the newsgroups, just don't
remember from were.

Sub Allcolor()
Dim c As Integer
Dim j As Integer
For c = 0 To 5
For j = 0 To 9
If c * 10 + j < 57 Then
Cells(c + 12, j + 2).Interior.ColorIndex = c * 10 + j
Cells(c + 12, j + 2).Value = c * 10 + j
End If
Next j
Next c
End Sub
HTH
John
"Matthew Dyer" wrote in message
...
On Jan 12, 2:02 pm, Tim Williams wrote:
Cell interior colors in XL2002 are limited to one of the 56-color
palette options.
If you try to use a color not in the palette it will just get mapped
(not sure exactly how) to the nearest match.

Tim

On Jan 12, 12:38 pm, Matthew Dyer wrote:



I'm trying to make a sheet that shows all the possible cell fill
colors available in Excel. I'm using Excel 2002, SP3. The code I made
is as follows -


Sub colors()
Dim i As String
i = 1
a = 1
Do Until a = 65536
Rows(a).Interior.Color = i
i = i + 10
a = a + 1
Loop
End Sub


I switched the i loop to go up by 10 because I wasn't getting any good
variety in colors, only red black and maroon. Even after switching to
intervals of 10 I'm still only getting reds yellows and greens along
with blacks... I know there should be some blues and purples. Anyone
have any ideas?- Hide quoted text -


- Show quoted text -


make's sense. So is there a way to code it so I can get all of the 55
possible colors to fill a cell with? (assuming 56th value is no fill
at all)




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default cell fill color spectrum

here's what i use, because it gives me hex values, too.


Sub Colors()
Dim ctr As Long

For ctr = 1 To 56
Cells(ctr, 1).Interior.ColorIndex = ctr
Cells(ctr, 2).Value = "'" & Right("000000" & _
Hex(ThisWorkbook.Colors(ctr)), 6)
Cells(ctr, 3).Value = ctr
Cells(ctr, 4).Value = Cells(ctr, 1).Interior.Color
Cells(ctr, 2).Font.Name = "Arial"
Cells(ctr, 2).HorizontalAlignment = xlRight
Cells(ctr, 3).HorizontalAlignment = xlCenter
Cells(ctr, 4).HorizontalAlignment = xlLeft
Next ctr

End Sub


--


Gary Keramidas
Excel 2003


"Matthew Dyer" wrote in message
...
On Jan 12, 2:02 pm, Tim Williams wrote:
Cell interior colors in XL2002 are limited to one of the 56-color
palette options.
If you try to use a color not in the palette it will just get mapped
(not sure exactly how) to the nearest match.

Tim

On Jan 12, 12:38 pm, Matthew Dyer wrote:



I'm trying to make a sheet that shows all the possible cell fill
colors available in Excel. I'm using Excel 2002, SP3. The code I made
is as follows -


Sub colors()
Dim i As String
i = 1
a = 1
Do Until a = 65536
Rows(a).Interior.Color = i
i = i + 10
a = a + 1
Loop
End Sub


I switched the i loop to go up by 10 because I wasn't getting any good
variety in colors, only red black and maroon. Even after switching to
intervals of 10 I'm still only getting reds yellows and greens along
with blacks... I know there should be some blues and purples. Anyone
have any ideas?- Hide quoted text -


- Show quoted text -


make's sense. So is there a way to code it so I can get all of the 55
possible colors to fill a cell with? (assuming 56th value is no fill
at all)

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
How do I fill one cell color with text html/rgb color from another thewris Excel Discussion (Misc queries) 2 January 22nd 09 12:24 AM
Match TextBox Back Color to Cell Fill Color AMY Z. Excel Programming 4 October 12th 06 06:07 PM
Cell Fill Color and text color - changes for recipient Shadowman13 Excel Discussion (Misc queries) 0 March 8th 06 11:32 PM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM
Set Cell Fill Color Martin Excel Programming 3 September 18th 05 03:38 PM


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