View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Spurious Response Spurious Response is offline
external usenet poster
 
Posts: 1
Default How to choose Random rows??

With a random row chooser of course!


On Sat, 4 Sep 2010 19:15:32 +0100, broro183
wrote:


hi Sarang,


Saarang84 Wrote:

Hi Rob,
Thanks for the reply. Your piece of code doesn't work.
'Filter Randomly based on Inputs' (http://tinyurl.com/2uqrugj)
Hope this thread (coded by mikerickson) helps...
Sarang



Please keep the responses in the thread so that any other helpers or
people looking for answers can also see the same information.



Out of the total number of rows filtered, say y, i need to choose x
rows randomly (where x<y). This x rows to be marked are stored in
randRow. The below line of code marks all the rows filtered. But i need
only x rows to be marked.


Do you want x rows marked from each time the filter changes on the
below lines of code?
Or do you want a total of x rows (after all the looping is done)?



VBA Code:
--------------------


For i = 1 To 10
.Columns("A:J" & Cells(Rows.Count, 1)).AutoFilter field:=1, Criteria1:="=" & i
--------------------




Rob