Select Random Cells In The Selection

Feb 8, 2009

I'm trying to select an x number of random selections within the selection.

Basically, lets say A1:A100 is selected, im going to have a inputbox asking how many to select, you put 10 in the inputbox, and then it randomly chooses 10 from A1:A100 and highlights them

This seems easy enough, i can do the input box and know the random function. just not sure how to set the beginning point and the ending point with Cell locations and then have it highlight those selections... a for loop I'm guessing?

View 9 Replies


ADVERTISEMENT

Select Random Row, Split Cells To Different Worksheets

Jul 26, 2009

I am trying to write a macro to:

1. Randomly selects 50 rows from 834 on "worksheet 1". There are only two cells per row.

2. Then, it clears "worksheet 2" and "worksheet 3".

3. From each selected row in "Worksheet 1", it splits the two cells and copies the results into two different worksheets, one column per sheet.

4. The rows in the two new worksheets should be congruent (i.e. same selected order from worksheet 1). Keeping the order the same is important.

This is what I have so far:

--------------------
Sub Macro1()
Dim rng As Range
Dim iRow As Long
With Rows("1:834")
Do
iRow = Fix(Rnd() * 834 + 1)
If rng Is Nothing Then
Set rng = .Rows(iRow)
Else
Set rng = Union(rng, .Rows(iRow))
End If
Loop Until rng.Areas.Count >= 50
End With

rng.Select

Selection.Copy Sheets("Sheet2").Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)

End Sub
-------------------

View 9 Replies View Related

Select Random Cells From Multiple Sheets And Copy

May 10, 2014

I would like to select say 2 id from sheet1 and 2 names from sheet 2 randomly and copy to sheet3, to cells a and b,have seen various codes but none seem to fit the bill.

View 3 Replies View Related

Select Blank Cells :: Selection Is Too Large

Feb 11, 2007

when I select 30,000 Row and 3 Columns then Edit>GoTo>Special>Blanks , Excel gives me MSG : selection is too large

View 2 Replies View Related

Select Cells And Then Take Input Into First Cell In Selection And Populate Rest

Jun 5, 2013

I have a scheduling tool that I need to do the following with -

Allow user to select a range of cellsUser types a value (non formulaic just plain text)Value gets populated to all selected cells

The reason I'm not just using fill handles is because of the amount of formatting in the cells.

View 6 Replies View Related

Random Data Selection

Jan 13, 2009

I have data for number of firms as :

year firm
1 1
2 1
3 1
1 2
2 2
3 2
1 3
2 3
3 3
.............
.............
1 1000
2 1000
3 1000

how can one chose random samlpe from this population.

View 3 Replies View Related

Sampling/Random Selection

Jun 28, 2009

I have a file (see SAMPLE file attached) with over 2000 records. I need to know if there is a way to do a sampling or random selection by ethnicity and gender in order to get a diverse population for only 60 individuals. The selection criteria should be on ethinicity and gender.

Is this possible?

View 10 Replies View Related

Random Number Selection...

Apr 19, 2006

random number selection...

i have a list of 200 items (rows) and i would like to "randomly" select 30 of them...(next month i will get another 200...)

View 3 Replies View Related

Random Selection Based On Criteria?

May 15, 2013

I have been able to put together the below which generates a random 15% sample of all records in the worksheet.

It works perfectly, however what I would ideally like to do is get it to only produce the 15% sample of rows where it is todays date in col B and has the word "other" in col C. I've tried lots of different IF statements and FOR statements, but am only generating blank worksheets.

Sub getrandomrows()
Dim lr As Long, lc As Integer, a As Variant, MyDate As Date
lr = Cells.Find("*", LookIn:=xlValues, after:=[a1], searchorder:=xlByRows, _

[Code].....

View 6 Replies View Related

Random Selection Of A Subset Of Numbers

Aug 29, 2008

I have a set of 20 numbers that I regularly wish to select 6 numbers from, without duplicates

View 9 Replies View Related

Random Selection Based On Odds

Jan 10, 2007

Create a random selection based on odds. It would be similar to the RANDBETWEEN function, but in this case I specifically want one of the three values to be selected randomly in cell C2 based on the odds given.

View 9 Replies View Related

Random Selection Based On Criteria

Jun 24, 2008

I am working on a challenging project. I have a list of names, job titles, and departments. Is it possible to select a random name who matches a specified job title or department? I'd prefer not to sort/filter/delete the original data range because the sheet will be used multiple times during the day by multiple users and with different criteria each time.

View 6 Replies View Related

Golf 4 Ball Random Selection With Preconditions

Apr 21, 2014

organising a golf tour for 32 players.playing in teams of 4 (4 Balls) for 4 games of golf and the teams are to be randomly selected such that no player plays in a group with a person he has played with in a previous game. finding it difficult to create a spreadsheet which meets this criteria.

need to build into the spreadsheet the fact that the variable mix of people is constrained by the fact that at least 4 persons have to use a buggy (which will have 2 people in it) and as the tour progresses and courses become physically demanding a number of people (N) for the last 2 rounds may also ask for the use of buggies as well.develop a spreadsheet to make the 4 Ball team selections.

View 2 Replies View Related

Random Selection With Multiple Column Criteria

Sep 3, 2009

I want to do is randomly pull from a field of data, MINUS any cells that do not meet the criteria in other columns. So if column A is my target column for the random selection (containing 10 unique entries), and column B has 10 repeating colors, and column C has 10 repeating animals, what can I use to perhaps create this effect: A random pull from column A, but only from rows in which column B says red and column C says cat? (The pull being 1, 4, 7, or 9 in the below example, of course.)

Data (this example is also attached in an excel doc):
One Red Cat
Two White Dog
Three Blue Horse
Four Red Cat
Five White Cat
Six Blue Cat
Seven Red Cat
Eight Red Dog
Nine Red Cat
Ten Red Horse

I have tried variations on IF and INDEX to no avail. Perhaps something with SUMPRODUCT?

View 3 Replies View Related

Generate Random Numbers In Random Cells

Sep 18, 2009

I am working on a Random Cycle Count Generator that provides random SKU#s based on 3 separate columns of SKU listings. The user clicks a button to generate the SKU#s to cycle count for that day. What I would like to see is a date stamp in the columns next(B,D,F) to the referenced SKU listing(A,C,E) based on which SKU#s are generated. This will let me see the last date that the SKU was generated. I would also like it to automatically save after generating.

View 2 Replies View Related

Random Option Selection Based On Variable Input

Jul 23, 2009

I need an action to allow for the random selection of a predetermined series of number codes which represent a given letter.

It is probably easier to look at the attached sheet and the previous discussion to see what I mean.

Previous discussion:
http://www.excelforum.com/excel-work...-of-cells.html

View 2 Replies View Related

VBA Random Name Select

Dec 12, 2012

I have been thinking about a name selection tool that would automatically pick a few names for internal audit. I can handle the useform launch and other basics but here is what I see happening.

1. The empname! sheet contains a list of all the company employees, with employee number in column A, names in column B and an "X" or blank in column C.

2. The main sheet called auditmaster! contains nothing currently

3. When the code is ran the userform prompts the user to select how many individuals to audit by entering an integer in a textbox.

4. If the user selects 5 for instance, the code will run and will select 5 random employees for internal audit. It does this by first checking column A of the empname! sheet and seeing what the highest and lowest numbers are. This would create the range for the random function.

Next if there is an "X" in column C of empname! sheet, those employees numbers are excluded from the random choice.

Following this the function will select the appropriate number of individuals to audit using random again and place their names/number on the masteraudit! sheet.

The detail should be placed as the following, employee number goes to column F, name to column G. Starting with row 10. The code should also number the results 1 - however many were selected for audit in column E.

View 2 Replies View Related

Random Select.

Sep 14, 2008

I want to random select one of the following,red,yellow,blue,green,orange & white. (as text) in cells A2:A1001.

View 9 Replies View Related

Random Selection Of A Data Located In A Column, By Text Color

Feb 5, 2009

I am wondering, in excel 2003 is it possible to randomly select two numbers from one column, say column b9:b45, that are random numbers, and selected by two different font colors. In other words: b9=1348, b10=1349, b11=1350, b12=1351, b13=1352, b14=1353.

Say we press a macro button, and in field B50 one radom black colored number is selected of a field of say 30 numbers that are all black in that column, and in b51, one red number is selected, in a field of 30 red numbers. We want to used this macro to select winners simulating a raffle drawing.

View 4 Replies View Related

Random Selection Of Cell Value From List Based On Changing Weighting

Apr 24, 2009

I have a list similar to the below:

#....|Name.... | Weighting %
1Artur Boruc 1
2Igor Tudor 5
3Alessandro Grandoni 3
4Gian Elia Amoretti 3
5Olivier Kapo 12
6Kim Källström 13
7Emiliano Bigica 13
8Julio Baldivieso 12
9Fabrizio Miccoli 13
10Peter Vougt 14
11Massimiliano Esposito 12

What I want to do is randomly select either number 1 to 11 (leftmost column OR the person it represents) but also make the selection based on the percentages in the rightmost column. To illustrate using the above example, Number 11 (Massimiliano Esposito) should have 12 times more chance of being randomly selected than Number 1 (Artur Boruc)...

I have used a formula such as

PHP
=INDEX(A$1:A$11,INT((RAND()*11)+1),1) 

to randomly select a cell but how would I modify this to include cell weightings? Or is there a better formula?

An additional note I have is that the weighting for each person will always be changing, but will always be a percentage.

View 11 Replies View Related

Random Number Select

Feb 5, 2007

I need a macro that will select a random number between 1 and 6. ie select the number of a dice. It needs to input 1 random value into one cell and another random value into another. Like the dice values of a monopoly game.

View 9 Replies View Related

Select Cell At Random

Dec 10, 2007

I have an excel sheet attached that I would like to customise to become a random seat picker. I wanted it to select a random cell representing a seat and highlight that cell in someway (e.g. change the background colour or text colour) and display the data within in in a cell in the middle of the sheet.

I have used formula to achieve the later half of the problem but am unsure how to highlight the cell. my current solution uses f9 to refresh the data. Ideally I would like to attach the behaviour to a command button. I have attached the excell sheet and have highlighted the problems I am having.

View 3 Replies View Related

How To Select 50 Random Values From Sheet1

Dec 13, 2013

How to copy and paste 50 values randomly from column A in sheet1 to Column A in sheet2.

View 5 Replies View Related

Random Function On Select Range?

Mar 14, 2014

I would like to use the random function on a range of select numbers. I tried randbetween() but it won't work for me since my range of numbers are not in sequence (e.g. 1,2,4,6,7,8,9,10,21). Using randbetween() might result in numbers not within my range..

View 2 Replies View Related

Select Random Number From List

Oct 23, 2009

Say I have a list of 100 numbers (in column A). What formula would I use to have Excel list (in column B) 50 random numbers from the list of 100 or column A?

View 6 Replies View Related

Select 30 Random Items From A List

Apr 30, 2014

I've got a list of items (formatted alphanumeric) in column G starting at row 2. I would like a cell formula that would randomly select 30 items from this column and place them in column H starting at row 2. One caveat is that the list must remain static once created. If the Rand()function is used, it recalculates whenever the worksheet is updated so that might be a problem.

Cell formula to do this? A VBA solution would be OK as well.

View 9 Replies View Related

Select 81 Winners At Random From 5000 Entries

Nov 26, 2013

I am looking at ways to select 81 winners at random from a spreadsheet with 5000 + names on it. I have tried assigning each cell with a value between 1 and 81 and then removing the duplicates but i cant seem to get excel to pick 81 unique numbers, instead it will pick no number 1, or two number 70s.

I have managed to get a macro to pick 1 cell at random but cant get it to pick across the whole range of 5000.

View 1 Replies View Related

Select Random Rows And Display On New Sheet

Mar 30, 2009

I need the selected rows to be displayed on a new sheet. The idea being that I have a quiz with hundreds of questions and I only want a random selection to appear when I execute the macro. I plan on hiding the original questions and only displaying the randomly selected ones.

Here is the original code from the previous post.

View 14 Replies View Related

Optimize Select Random Cell Value Without Duplicates Code

Apr 6, 2013

I have two worksheets. ws1 contains a large number of dates on column 3. ws3 contains around 20 dates on column 3.

I want to pick two dates randomly in ws1 that does not already exist in ws3.

Here is my working code, but it is really slow to process. How to optimize this code? Also I would like to add a function where if the macro is not able to find two random dates that aren't already in ws3 then exit loop.

VB:
Set ws1 = thisworkbook.sheets(1)
Set ws3 = thisworkbook.sheets(3)

lr = ws2.Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row
Set rvis = ws2.Range("c2:c" & lr).SpecialCells(xlCellTypeVisible)
mynodate = 0

[Code] .....

View 7 Replies View Related

Random Select One Line Of Data For Each Person In A List

Dec 20, 2012

I would like to know how I can get excel to randomly select one line of data for each of the people listed below (so one for bob, one for jenny, one for Trish etc.). I have been trying a mixture of vlookup and rand but to no avail, below is just a sample list but I would like to try it on a large set of data. I have been able to get a random transaction but not one for each person.

Code:
a1
b
c
d
e
f
g
h
i
j

2

3

4
REF_ID
NAME
DATE
BILL TOTAL

[Code] .....

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved