View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
broro183[_166_] broro183[_166_] is offline
external usenet poster
 
Posts: 1
Default How to choose Random rows??


hi Saarang,

Thank you for identifying & providing the link to the crosspost -
hopefully we can help.




Saarang84;740535 Wrote:

...


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


Resize(.Rows.Count - 1, 1).Offset(i, fCol).SpecialCells(xlCellTypeVisible) = "Sample_" & i
--------------------



I want to mark only certain number of rows (stored in the variable

randRow) as samples. But the above line of code marks all the rows
filtered. How can this be fixed??



I don't think it's very likely but does the below work?


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


Resize(.Rows.Count - 1, 1).Offset(i, fCol).SpecialCells(xlCellTypeVisible).resize(randR ow,1).value2 = "Sample_" & i
--------------------



If not, then you may have to loop through each area within the range of
visible cells until you get to the number of rows represented by
randRow. I'll look through your code in detail over the weekend & see if
I can come up with an answer for you...

hth
Rob


--
broro183

Rob Brockett. Always learning & the best way to learn is to
experience...
------------------------------------------------------------------------
broro183's Profile: http://www.thecodecage.com/forumz/member.php?u=333
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=207872

http://www.thecodecage.com/forumz


--- news://freenews.netfront.net/ - complaints: ---