LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
N10 N10 is offline
external usenet poster
 
Posts: 141
Default how do i fill cells with random color?


"Casey" wrote in message
...
I am trying to fill a grid of equal sized cells with random colors, or
colors
attached to a random number. I can fill the grid with random numbers
easily
enough, it's the colors i want.
Thanx....Casey



Hi Casey

Try this then adpat to your needs


Sub colorit()


Dim task As Range
Dim myvalue
Set task = Range("A1:l32")


For y = 1 To 5

For Each Cell In task
Randomize

myvalue = Int((56 * Rnd) + 1)

Cell.Interior.ColorIndex = myvalue

Next

Next

'
End Sub


 
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 can I fill a block of 300 cells with non-repeating random #s nerkaman Excel Discussion (Misc queries) 1 July 3rd 09 08:16 PM
Fill and Font Color Drop Downs Mostly White with Random Colors dball Excel Discussion (Misc queries) 2 August 24th 06 05:22 AM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM
fill random cells hulub[_2_] Excel Programming 0 September 20th 04 05:44 AM
fill random cells hulub Excel Programming 1 September 19th 04 08:26 PM


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