Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default RANDOM HIGHLIGHTER!!

Range(A5:K1000) contains characters.
The macro should randomly highlight 120 rows (entire rows, that is) in
the above range yellow.

Any help would be much appreciated !

Thanks
Jay Dean



*** Sent via Developersdex http://www.developersdex.com ***
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 179
Default RANDOM HIGHLIGHTER!!

Hi Jay Dean, hth:
------------------------------------------------
Sub RandomColor()

Dim int_ As Integer

Randomize

For j = 1 To 120
int_ = 9995 * Rnd() + 5
Do While Cells(int_, 1).Interior.ColorIndex = 6
int_ = int_ + 1
Loop
Rows(int_).Interior.ColorIndex = 6
Next j

End Sub
------------------------------------------------

Cheers Carlo
"jay dean" wrote:

Range(A5:K1000) contains characters.
The macro should randomly highlight 120 rows (entire rows, that is) in
the above range yellow.

Any help would be much appreciated !

Thanks
Jay Dean



*** Sent via Developersdex http://www.developersdex.com ***

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default RANDOM HIGHLIGHTER!!

if you are trying to pull a 120 row sample from the data, insert a new column A

in A5 put in
=rand()
and drag fill down the column. sort on this column and select the first
120 rows.

--
Regards,
Tom Ogilvy


"jay dean" wrote:

Range(A5:K1000) contains characters.
The macro should randomly highlight 120 rows (entire rows, that is) in
the above range yellow.

Any help would be much appreciated !

Thanks
Jay Dean



*** Sent via Developersdex http://www.developersdex.com ***

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 154
Default RANDOM HIGHLIGHTER!!

Thanks to you both Carlo and Tom!
Actually, it looks like my Sample Space will increase so, I needed a
macro.

I therefore, modified Carlo's code a little bit and now it seems to be
working fine. Thanks again!

Jay Dean



*** Sent via Developersdex http://www.developersdex.com ***
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
highlighter jlm@yell-o-glow Excel Discussion (Misc queries) 1 January 24th 06 05:24 PM
Excel row highlighter I_am_a_MS_user Excel Discussion (Misc queries) 4 October 10th 05 10:58 PM
Copy highlighter donbowyer Excel Programming 3 September 25th 05 04:00 PM
Highlighter Zip Codes Excel Programming 2 June 22nd 05 07:31 PM
row highlighter numcrun Excel Programming 1 July 16th 03 01:22 PM


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