LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default REpeating Values

Hello,

I have some code that generates Random draw winners, but if a name is
repeated in the list I want to have a pop-up identifing this and ask me if I
want the name changed or kept the same, this is just in case there is only 1
entry with 3 prizes.

I have placed the code below (I know it is messy but this is the only way I
know how to write code)

Please help

Application.Goto Reference:="Random_Number_Generator"
ActiveCell.FormulaR1C1 = "=ROUND((RAND()*(1-" & ValueMAM & ")+" &
ValueMAM & "),0)"
Application.Goto Reference:="MAM_Winner_1"
ActiveCell.FormulaR1C1 =
"=vlookup(Random_Number_Generator,MAMDraw!A:B,2,0) "
SendKeys "{f2}" & "{Enter}", True
Application.Goto Reference:="MAM_Winner_1"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Application.Goto Reference:="MAM_Winner_2"
ActiveCell.FormulaR1C1 =
"=vlookup(Random_Number_Generator,MAMDraw!A:B,2,0) "
SendKeys "{f2}" & "{Enter}", True
Application.Goto Reference:="MAM_Winner_2"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Application.Goto Reference:="MAM_Winner_3"
ActiveCell.FormulaR1C1 =
"=vlookup(Random_Number_Generator,MAMDraw!A:B,2,0) "
SendKeys "{f2}" & "{Enter}", True
Application.Goto Reference:="MAM_Winner_3"
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
repeating values Peach Excel Worksheet Functions 1 November 29th 09 02:45 AM
repeating values [email protected] Excel Worksheet Functions 2 June 12th 08 04:55 PM
can i stop repeating values? Haitham Excel Discussion (Misc queries) 2 August 3rd 06 09:01 AM
excluding repeating values neda5 Excel Discussion (Misc queries) 2 July 10th 05 11:59 PM
Repeating Values Elaine Excel Programming 3 March 1st 05 06:47 PM


All times are GMT +1. The time now is 05:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"