Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Entries Help
Hi, Everyone
I am trying to create a macro pull random data from my data sheet 10 at a time. i.e. 1. I have two sheets - Sheets("A") and Sheets("Data") 2. Sheets("A") is blank sheet where Sheets("Data") has number&alphabet combined code from Range("A1:AM65536") 3. How do I macro to pick 10 of any cell's value in Sheets("data") and place in sheets("A").Range("A1:A10") ? i.e Each time I run macro it will select 10 values from data sheet randomly and places it in sheet A from Cell A1. Thank you for your help in advance |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Random Entries Help
Calculate random column 1-39 (A-AM) and random row 1-65536 transfer value
from Data to Sheet A Optional last 2 lines in loop to display actual col and row used, in SheetA columns B & C. Sub RandomFill() Dim rRow As Single, rCol As Single, iRow As Integer Randomize For iRow = 1 To 10 rCol = Int((39 * Rnd) + 1) rRow = Int((65536 * Rnd) + 1) Sheets("A").Cells(iRow, "A") = Sheets("Data").Cells(rRow, rCol) 'Sheets("A").Cells(iRow, "B") = rCol 'Sheets("A").Cells(iRow, "C") = rRow Next End Sub -- Regards, Nigel "James8309" wrote in message ... Hi, Everyone I am trying to create a macro pull random data from my data sheet 10 at a time. i.e. 1. I have two sheets - Sheets("A") and Sheets("Data") 2. Sheets("A") is blank sheet where Sheets("Data") has number&alphabet combined code from Range("A1:AM65536") 3. How do I macro to pick 10 of any cell's value in Sheets("data") and place in sheets("A").Range("A1:A10") ? i.e Each time I run macro it will select 10 values from data sheet randomly and places it in sheet A from Cell A1. Thank you for your help in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to identify unique list of 200 random entries from a list of 3 | Excel Worksheet Functions | |||
debug repeat entries with a random function and erase the rest | Excel Programming | |||
Random select entries | Excel Discussion (Misc queries) | |||
Non-random numbers generated by excel's data analysis random gener | Excel Discussion (Misc queries) | |||
entries into random cells | Excel Programming |