Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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: --- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I choose the rows that are filtered ? | Excel Programming | |||
Is it possible to choose a certain amount of rows and have them ex | Excel Worksheet Functions | |||
Formula to choose X number of unique random cells from array? | Excel Programming | |||
how to choose random namber form loop? | Excel Programming | |||
How can I choose alternate rows in a column? | New Users to Excel |