Random seclection of data from a list in exl

Closed
Report
-
Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
-
Hello,
I have three sheets
1) Data
2) Sample
3) Dummy

In the data sheet in the first two colum the data is present colum A contains managers and colum B comtains some alpha numerics

In the Dummy sheet the macro should take the list of unique managers and their numbers in front of them.

now i want the user to input the nos of managers data to be seclected randomly.

Eg: id ram has 100 deals and the user inputs 20% then only 20 deals should be seclected and copied in the sample sheet.

I am able to get build a macro till preparing the list and removing the % as per the user input in a table format.

i am not able to get the ramdom seclection of deals and coping it to the sample sheet below one another.

Hope u have got the point.

Help me please.

1 reply

Posts
1864
Registration date
Sunday June 14, 2009
Status
Contributor
Last seen
August 7, 2021
804
to get random numbers between 1 and 100 use this macro

Sub test()
Range("e1").Formula = "=randbetween(1,100)"
Range("e1").Copy Range("e2:e20")
Range("e1:e20").Copy
Range("e1").PasteSpecial xlPasteValues
End Sub


modify to suit you and use these cell values suitably in your main macro
0