Hi,
Welcome to One and All!!!
Yesterday, i joined this forum, was browsing through and searching for some excel VBA stuff that would aid me in an automation which i'm currently involved in.
This automation is mainly aimed at randomizing a manual sampling for a process. I'm trying to build a "Enterprise Solution" that will help manage this. Refer attached document to get an idea ...
Hi,
Let me give more clarity on what i'm trying to do:
I've a big chunk of data (which is used to choose samples) which is filtered frequently and is used up in parts to determine the samples.
Just to explain more clearly of my requirement,
When i say i want to export data to new sheet(s), i need to determine the filtered row numbers and not actually exporting the whole data ...
Sarang84 Sarang84 is offline Newcomer replied 2 months ago
Hi,
Let me give more clarity on what i'm trying to do:
I've a big chunk of data (which is used to choose samples) which is filtered frequently and is used up in parts to determine the samples.
Just to explain more clearly of my requirement,
When i say i want to export data to new sheet(s), i need to determine the filtered row numbers and not actually exporting the ...
Hi,
To get a more clear picture of my requirement, just read through the document attached. Also attached are 2 other code modules.
I've coded these modules to implement random sampling. These 2 modules need to combined and made to work together.
One of the modules is called " Filter_N_Transfer " and another is called " Random Sampler ".
I need to design a piece ...
Hi,
Can anyone explain clearly (using layman terms) about how to go about randomly choosing specific number of rows from a set of autofiltered records?
For e.g., If there are 1000 rows of data in a worksheet with 50 columns and after applying autofilter to certain column(s) [one or more] say i get some 75 rows. Then how can x no. of rows be chosen where x can be input by ...
Hi,
I think the first thing to concentrate on is the randomness factor, because this is probably the most difficult part to get right.
Suppose, as you say, you have 75 filtered rows and you want to randomly pick 8 (how the 8 is derived is not important right now) of them. For the time being also ignore the fact that you want 8 "visible rows" and just consider the problem as ...
I'm attaching the random module that i'd developed initally with this post. I call this module as " Random Sampler " and it has a method called " ExtractRandom " that needs to tweaked as required.
Since no two users can be assigned the same row of data, the 1st method suggested by Mr. BillSoo (i don't know his / her real name) in the 2nd post in the tutorial would suit my ...
Hi,
I understand that i need to integrate the method suggested by Mr. BillSoo in his post on generating random numbers. On the other side, i also am thinking about getting the autofiltering part coded. I've a basic random sampler module coded which i've attached in my earlier post.
Ranga
Hi Colin,
I've been coding my random number generator and this is what i've come up with:
Code:
Option Explicit
Sub ExtractRandom()
Dim NumToExtract As Long
Dim NumRows As Long
Dim msg, style, title, response
Dim DataSheet As Worksheet
Dim wsExtract As Worksheet
msg = "This macro will extract the requested number of records" _...
There can be "x" no. of users for whom sample rows of processed data (generated for about 57 different rule codes) have to be chosen randomly (from 2 different types of worksheets containing data). The sampling is done every fortnight and is based on certain percentages and conditions. They are:
All users with less than 9 months vintage and;
All new rules for first three ...
Hi Colin,
I've integrated the coded modules together. I've designed an interface (which can be simplified) and also want to consolidate the sample rows together into a separate sheet.
Can you help me code a module that can pick out and collate sample rows from the filtered records? I've also attached my random code.
Ranga
Hi Colin, I've developed a random generator code which needs tweaking a bit.. I've used the rank formula to highlight rows (using conditional formatting) didn't get any other idea. Can this be done in the way specified as in the random number tutorial? Sarang
Hi Colin, I've developed a random generator code which needs tweaking a bit.. I've used the rank formula to highlight rows (using conditional formatting) didn't get any other idea. Can this be done in the way specified as in the random number tutorial? Sarang
Hi, I think the first thing to concentrate on is the randomness factor, because this is probably the most difficult part to get right. Suppose, as you say, you have 75 filtered rows and you want to randomly pick 8 (how the 8 is derived is not important right now) of them. For the time being also ignore the fact that you want 8 "visible rows" and just consider the problem as how to retrieve 8 unique, random and whole numbers...
Thread profile page for "Random Sampling" on http://www.xtremevbtalk.com.
This report page is a snippet summary view from a single thread "Random Sampling", located on the Message Board at http://www.xtremevbtalk.com.
This thread profile page shows the thread statistics for: Total Authors, Total Thread Posts, and Thread Activity