Get Random Prize Draw Working With In Excel?
Apr 17, 2014
I'm trying to get a random prize draw working with in excel. My worksheet structure as follows.
A1 person's name
B2 points obtain by the person.
A1 B2
John 10 points
Ken 20 points
Amy 30 points
1st draw. If random number result between 1 and 10 display John wins then delete John's entries.
2nd draw etc... and delete anyone that has already won a prize.
With the following code I found on this forum it partly works. It only randomly select a cell but missing displaying the winner and removing it afterwards.
[Code]......
View 4 Replies
ADVERTISEMENT
Dec 1, 2008
I was looking for some code to randomly generate a number for a prize draw I am doing. I found a great piece on this site, which I have slightly changed to give me what I have below.
It works great except for one thing I cannot work out, I have the code below working on cell "C1", I would like it to work in cell "C5", but I can't seem to work this out.
Sub SlotsNum()
Dim w As Long, x As String, y As Long
Randomize
x = Format(Int((Range("B2") - Range("B1") + 1) * Rnd + Range("B1")), "0000")
For y = 1 To 1
For w = 1 To 250
Range("C" & y) = Int(8000 * Rnd)
Next w
Range("C" & y) = CInt(Mid(x, y, 4))
Next y
End Sub
Also, whilst here. i will have one other problem, with it being a prize draw I do not want to draw the same number twice. At the moment I have a small macro that copies the winning name that appears on the main screen (via a vlookup) onto a winners spreadsheet. I am thinking of then creating another macro that replaces the winning name on the master list with an "Already Won" entry, so we can just select again.
View 9 Replies
View Related
Sep 20, 2012
I have the below code that i am using to generate a random number between a user defined lower limit and upper limit (these limits are set in cells "B3" and "B4" in worksheet "DRAW"), the random number that is generated displays in cell "B7" on worksheet "DRAW".
The code also allows for the draw result to be stored on a second sheet called "DRAW HISTORY", on this sheet the draw result, date and time are recorded (the date and time are stored on sheet "DRAW" in cells "C20" & "C21" and these values are pulled to the result sheet by the macro).
What i would like to happen though is instead of the random number displaying instantly i would like the numbers to cycle for 3 seconds before stopping and the result being recorded. A much better visual effect than an instant BANG here is the winner.
here is the code i am using to generate the random number and record the result:
Sub testRandom()
Dim aRow As Long
Sheets("DRAW").Range("B7") =
[Code]....
View 3 Replies
View Related
Nov 17, 2008
Format Random Number Cells As Draw Result Entered ...
View 9 Replies
View Related
Dec 17, 2013
How to draw Olympics rings in Excel?(not by using macros)?
View 7 Replies
View Related
May 30, 2014
I have to draw a polygon of n sides whose , whose length of side will be given in the cells of excel and the diagram should be displayed in excel itself automatically
Like I have A1=5 A2=5 B1=4 B2=3 C4=5
Then diagram should be like in the attachment : Untitled5.png
View 2 Replies
View Related
Sep 5, 2013
I want to put a length in one cell and a width in another. Then have excel draw a square/ rectangle to this size. It could just outline cells, each cell being one inch or any other way.
View 9 Replies
View Related
Apr 7, 2014
I am new to Excel VBA and am trying to create a macro that will draw information from a spreadsheet. The code i have written so far is shown below:
Sub Event1()
'Dim Event Date As Double
Dim Message As String
Dim Ans As String
' Prompt for Data
[Code] ......
The section i am having issues with is shown in red above.
What i am trying to do is have a message box pop up with the information as shown based on a date being typed into the the original box that pops up (Please enter a date and click on OK). The following message box then displays the required information from the spreadsheet.
View 4 Replies
View Related
Jan 25, 2010
I have a workbook in excel 2003 which I had been running the following macros (listed below). We recently upgraded to Excel 07, and neither are working. When I try to run them, the "debug" option highlights the following line in the sort macro "Range("A2:z" & lastcell).Sort key1:=.Columns(1)". This is driving me crazy, as the macros worked perfectly under the older version of Microsoft. Is there an issue with crossfunctionality between '03 and '07'.
Private Sub Worksheet_change(ByVal target As Excel.Range)
If target.Column = 1 Then
ThisRow = target.Row
startRow = 1
i = 1
Set ws = ActiveSheet
maxRow = Cells.SpecialCells(xlLastCell).Row
maxCol = Cells.SpecialCells(xlLastCell).Column
ActiveSheet.UsedRange.Interior.ColorIndex = xlNone
Do While i
View 9 Replies
View Related
Apr 24, 2009
I have 2 UserForms at the moment. They only serve as a sort of welcome screen when you open the xls file. I have this code to open the Userform.
View 14 Replies
View Related
Jul 22, 2012
I'm currently working on my masters dissertation and am using excel 2010.
Basically, I'm trying to generate a list of say, 1000 numbers within a range. I can already do this using the rand() function. However, I need excel to take each random number, apply it into a formula, and then list the answers in a seperate location. This would be easy to do if there was one simple function (which i could just insert into any adjacent cell). The problem is that each random number value is input into a table. The table, which has about 10 columns and 200+ rows, gives one final answer.
I'm sure there has to be a faster way than creating 1000 tables for each random number generated.
Let's say I have a list of 1000 random numbers in sheet 1. the function table is in sheet 2 and produces the answer in the same sheet, in a single cell. I'd like excel to use each random number generated, input it into the function table, attain the answer from the table, and list it in the cell next to the random number.
View 2 Replies
View Related
Feb 22, 2014
I would like to know how to use macro to create quiz. in the quiz question are appear randomly from the question bank.
View 1 Replies
View Related
Jul 22, 2012
I'm currently working on my masters dissertation and am using excel 2010.
Basically, I'm trying to generate a list of say, 1000 numbers within a range. I can already do this using the rand() function. However, I need excel to take each random number, apply it into a formula, and then list the answers in a seperate location. This would be easy to do if there was one simple function (which i could just insert into any adjacent cell). The problem is that each random number value is input into a table. The table, which has about 10 columns and 200+ rows, gives one final answer.
I'm sure there has to be a faster way than creating 1000 tables for each random number generated.
Let's say I have a list of 1000 random numbers in sheet 1. the function table is in sheet 2 and produces the answer in the same sheet, in a single cell. I'd like excel to use each random number generated, input it into the function table, attain the answer from the table, and list it in the cell next to the random number.
View 1 Replies
View Related
Aug 11, 2014
Im looking to create random data for an athlete over about 4 months with daily tests, however when im using the =randbetween(*,*) function the data is too 'Random'. so im looking to create a trend in the data, like real athletes will have. is there a function in Excel 2010 that can do this?
The boundaries of the data are -336,416 (i know its quite a big range)
View 8 Replies
View Related
Aug 23, 2013
I want to generate random times in excel between upper and lower limits , which i can do , but i also want dates in same cells with out randomization , means dates should act independently and time should randomize
it should be something like that
8/1/2013 05:55 AM
8/2/2013 07:55 AM
8/3/2013 04:44 AM
View 4 Replies
View Related
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
Jul 18, 2012
How do I create a 6 digit unique random number for use as an ID in column A. Once created the rows with preexisting 6 digit unique random ID numbers must not change every time new rows are added.
View 9 Replies
View Related
May 19, 2014
I am trying to create challenge/response cards. Each card will have a 5-digit number in the upper-left and lower-right corner along with a series of rows containing a line number and 3 pairs of challenge/response words.
Rather than have have copies of these cards, I want the central office to have a macro-enabled workbook wherein they can enter the two numbers from the card and have the challenge/response matrix regenerate on a worksheet.
So, essentially, I want the challenges random number generator seeded from one of the 5-digit numbers and the responses random number generator seeded from the other 5-digit number.
I am trying to use
Code:
Randomize(Seed)
where Seed is one of the 5-digit numbers.
The problem appears to be that, no matter what I use for Seed, the RND(-1) function is not resulting in different numbers.
I am using Excel 2007 and Excel 2010.
View 1 Replies
View Related
Nov 24, 2011
i have a problem in that i need to generate a random 6 digit number preceeded by an X if the data in column B is either blank or 0. This needs to be filled in if the adjacent cell in column C has data in. i am a moderate macro writer and am finding this part quite challenging.
i am ussing excel 2007.
View 3 Replies
View Related
Dec 3, 2009
i want to make a cup draw, but i don't want to use RAND, I want to use VBA.
What i want is to make a English Football League Cup, so all 92 leagues teams are in it, but as follows
First Round 72 teams
Second Round 50 Teams
Third Round 32 Teams
Fourth Round 16 Teams
Quarter-Finals 8 Teams
Semi-Final 4 Teams
Final 2 Teams
for a team list see attached excel spreadsheet
If you are not sure what i mean google search English League Cup or try soccerway
I want a command box or similar for each round, i dont want it to change unless i click on the command button again.
i will be inputing the scores myself.
Sorry i forget one team in the First round "Darlington"
View 14 Replies
View Related
Apr 4, 2009
Ive been trying to draw a circle in excel, although it only draws ovals - Is there a way to draw a circle in excel?
View 9 Replies
View Related
Nov 28, 2009
I'm creating a spreadsheet regarding football teams and want to lis thte combinations of results for each team.
Specifically, if the team will win or draw.
So, I have 6 teams, each team can either win or draw.
I want to display the combinations of team 1 winning AND team 2 winning AND team 3 winning etc.
View 9 Replies
View Related
Feb 5, 2014
I notice that sometimes the "Go To" function does not work. When I click on the named range Excel just brings the cursor to a the first cell of a worksheet rather than the actual cell/range. I find that I need to restart Windows in order to fix this. A simple restart of Excel does not work.
View 4 Replies
View Related
Jan 22, 2010
Is it possible to add horizontal lines to a user form, like as shown in the attached image. I know about frames, but unsure how to get just one horizontal line.
View 3 Replies
View Related
Dec 18, 2012
i have faced a problem i want to draw straight connector using code imagine when you select straight connector to draw line mouse cursor changes when you move it to a node i want to do this with excel vba code without going to shapes and selecting connector.
View 5 Replies
View Related
Aug 14, 2013
I'm trying to use VBA to draw a border using the drawing toolbar and using the line. i need it to draw a border around a select area i hightlight.
i have attached a example below, but not sure if it will appear.
View 1 Replies
View Related
Mar 7, 2014
I have this Command button that switches on and draws a line. If you press it again then I need to delete that line.
If I push the button multiple times Excel keeps changing the name of the line. I have multiple lines on the same worksheet and text boxes but only this 1 line needs to be delete. I would think that theres a way to assign a permanent name to this line and delete and recreate it but...
ActiveSheet.Shapes.AddConnector(msoConnectorStraight, 319.5, 77.25, 319.5, _
245.25).Select
With Selection.ShapeRange.Line
.Visible = msoTrue
.Weight = 1.25
[Code]....
View 3 Replies
View Related
Dec 30, 2009
I have a 5-column listbox in a userform. I do not know how to make the column borders visible. If somebody can tell me, that would be great.
If not, then the next alternative would be to manually draw a line. I tried to so one, by creating a Label with a width of 1, and backcolor ot black. This works but not in front of a list box. For some reasons it cannot be brought to front/forward (order) of a listbox, I already right-clicked several times and sent tthe order to front.
Is it possible to bring it in front of a listbox?
View 9 Replies
View Related
Feb 21, 2012
when I use the above key stoke nothing happens in excel. It won't get me into vba editor??
using Dell laptopInspiron N4010 and office 2003
View 2 Replies
View Related
Nov 12, 2013
I have attached a very simple example of what I am trying to achieve.So we have 2 sheets. a sheet called data and a sheet called results.
the data sheet, includes ID's of employees and what they are measured on - Hours and Accounts Finished.For example, worker 123 put in 100 hours from the 200 expected and finished 100 accounts from the 200 expected. The main sheet called Results looks up in a list every ID and displays in a table the compensation the worker got. Each time you select from the drop list a different ID number it shows the result and the amount of money they got.
I want to be able to draw every worker and display the compensation they got('Results', H11) in the Pay amount column('Data',H3:H11).
View 6 Replies
View Related