RINCONPAUL
12-19-2015, 10:33 PM
On sheet '40%' of the attachment I want to place a macro trigger button. This trigger would action the following:
1/ Sort all the data rows in a random order (apart from rows 1 & 2 )
2/ Count the number of randomly sorted rows and calculate 60% of the row count. In the attachment it would be 60% of 28 rows = 17 rows (rounded)
3/ Copy the first 17 rows and paste into Sheet1
4/End of macro.
Now I can record this but have come up with two problems that my limited knowledge of vba can't solve?
1/The total number of rows on the '40%' worksheet varies, so the reference needs to be dynamic.
2/ I've had no success in randomly mixing up the data with a trigger.
The concept is to take a set of historical data, take a 60% sample of it all mixed up and not in time order, this sample then goes to a pivot table for further analysis, but along with other runs of the same sampling, to generate an unbiased total sample, for analysis going forward.
Cheers and Happy Holidays to all.
1/ Sort all the data rows in a random order (apart from rows 1 & 2 )
2/ Count the number of randomly sorted rows and calculate 60% of the row count. In the attachment it would be 60% of 28 rows = 17 rows (rounded)
3/ Copy the first 17 rows and paste into Sheet1
4/End of macro.
Now I can record this but have come up with two problems that my limited knowledge of vba can't solve?
1/The total number of rows on the '40%' worksheet varies, so the reference needs to be dynamic.
2/ I've had no success in randomly mixing up the data with a trigger.
The concept is to take a set of historical data, take a 60% sample of it all mixed up and not in time order, this sample then goes to a pivot table for further analysis, but along with other runs of the same sampling, to generate an unbiased total sample, for analysis going forward.
Cheers and Happy Holidays to all.