Pick a Random name from a list.
I am working on a Free Give Away of some products. Our systems give me a
list of individuals who we have had contact which are then placed in excel. We would like to pick a weekly winner and would prefer not to throw darts at my screen. Any Ideas? |
Pick a Random name from a list.
If there are 1700 names in column A in cells A1:A1700, then
=OFFSET(A1,INT(1700*RAND()),0) should do the job. Jerry "David M Fritzke" wrote: I am working on a Free Give Away of some products. Our systems give me a list of individuals who we have had contact which are then placed in excel. We would like to pick a weekly winner and would prefer not to throw darts at my screen. Any Ideas? |
Pick a Random name from a list.
Thanks I will give it a Try!
"Jerry W. Lewis" wrote: If there are 1700 names in column A in cells A1:A1700, then =OFFSET(A1,INT(1700*RAND()),0) should do the job. Jerry "David M Fritzke" wrote: I am working on a Free Give Away of some products. Our systems give me a list of individuals who we have had contact which are then placed in excel. We would like to pick a weekly winner and would prefer not to throw darts at my screen. Any Ideas? |
Pick a Random name from a list.
Is there a way to show just the random name graphically and make this
automatic for a daily drawing that takes place at a set time daily. "Jerry W. Lewis" wrote: If there are 1700 names in column A in cells A1:A1700, then =OFFSET(A1,INT(1700*RAND()),0) should do the job. Jerry "David M Fritzke" wrote: I am working on a Free Give Away of some products. Our systems give me a list of individuals who we have had contact which are then placed in excel. We would like to pick a weekly winner and would prefer not to throw darts at my screen. Any Ideas? |
Pick a Random name from a list.
Depends what you mean by graphically.
Adapting Chip Pearson's VBA Timer code at: http://www.cpearson.com/excel/ontime.htm and using Jerry's code, you could make the StartTimer sub (see below) the subject of a Workbook open event, or just run it manually. A message box will pop up at 11 a.m with the name of the winner. If you want some fancy graphics then you could design a userform containing a label, which gets populated with the name of the winner. You could show this form at the appropriate time instead of the Message box. HTH Public RunWhen As Double Public Const cRunWhat = "Winner" Sub StartTimer() RunWhen = TimeSerial(11,00,00) Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, schedule:=True End Sub Sub Winner() Dim stWinner As String StartTimer stWinner = Range("A1").Offset(Rnd() * 1700, 0) MsgBox "Today's winner is : " & stWinner End Sub On Thu, 24 Aug 2006 09:16:02 -0700, Stafford wrote: Is there a way to show just the random name graphically and make this automatic for a daily drawing that takes place at a set time daily. "Jerry W. Lewis" wrote: If there are 1700 names in column A in cells A1:A1700, then =OFFSET(A1,INT(1700*RAND()),0) should do the job. Jerry "David M Fritzke" wrote: I am working on a Free Give Away of some products. Our systems give me a list of individuals who we have had contact which are then placed in excel. We would like to pick a weekly winner and would prefer not to throw darts at my screen. Any Ideas? __ Richard Buttrey Grappenhall, Cheshire, UK __________________________ |
Pick a Random name from a list.
Thanks. I'll see if I can get it to work.
"Richard Buttrey" wrote: Depends what you mean by graphically. Adapting Chip Pearson's VBA Timer code at: http://www.cpearson.com/excel/ontime.htm and using Jerry's code, you could make the StartTimer sub (see below) the subject of a Workbook open event, or just run it manually. A message box will pop up at 11 a.m with the name of the winner. If you want some fancy graphics then you could design a userform containing a label, which gets populated with the name of the winner. You could show this form at the appropriate time instead of the Message box. HTH Public RunWhen As Double Public Const cRunWhat = "Winner" Sub StartTimer() RunWhen = TimeSerial(11,00,00) Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, schedule:=True End Sub Sub Winner() Dim stWinner As String StartTimer stWinner = Range("A1").Offset(Rnd() * 1700, 0) MsgBox "Today's winner is : " & stWinner End Sub On Thu, 24 Aug 2006 09:16:02 -0700, Stafford wrote: Is there a way to show just the random name graphically and make this automatic for a daily drawing that takes place at a set time daily. "Jerry W. Lewis" wrote: If there are 1700 names in column A in cells A1:A1700, then =OFFSET(A1,INT(1700*RAND()),0) should do the job. Jerry "David M Fritzke" wrote: I am working on a Free Give Away of some products. Our systems give me a list of individuals who we have had contact which are then placed in excel. We would like to pick a weekly winner and would prefer not to throw darts at my screen. Any Ideas? __ Richard Buttrey Grappenhall, Cheshire, UK __________________________ |
All times are GMT +1. The time now is 05:46 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com