Hey, every genius, please help me~
Range("_Data") is my data, I need to select randomly from it without duplicated items.
But my syntax seems doesn't work, how can I do it?
Please Login or Register to view this content.
Hey, every genius, please help me~
Range("_Data") is my data, I need to select randomly from it without duplicated items.
But my syntax seems doesn't work, how can I do it?
Please Login or Register to view this content.
Last edited by Leith Ross; 03-23-2013 at 02:34 PM. Reason: Added Code Tags
Assuming "_Data" has duplicates in the range.
Please Login or Register to view this content.
Thanks very much, so normally we must do it by using "Scripting.Dictionary", right?
Could we just use simple For Next or Do Loop to do it?
It's fully depends on your data set and what you want.
Don't want to do a guess job.
OK, I got it, sorry for such a newbird question.
Actually In my data [_Data], there is no duplicate items, I just want that no duplicate items in my random selection. Because if I only use Application.WorksheetFunction.RandBetween(1, datarng.Rows.Count), it's happens sometimes there are duplicate items in my random selection.
If not dups, this should do.
Please Login or Register to view this content.
Ok, thanks very much again, it seems more complicated if we don't use "Scripting.Dictionary",
so, It's better use to "Scripting.Dictionary", no matter whether there is duplicate items in data range, we can randomly select items without duplicates.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks