Sub Winners5()
Range("B2").Select
Application.DisplayFormulaBar = False
ActiveWindow.DisplayHeadings = False
If Range("F1").Value = "!@#" Then
If WorksheetFunction.Count(ActiveCell.EntireColumn) < 2 Then
Do
ActiveCell.Formula = "=INDEX(OFFSET(Sheet2!$B$1,1,0,COUNTA(Sheet2!B:B)),RANDBETWEEN(1,COUNTA(Sheet2!B:B)-1))"
Do While WorksheetFunction.CountIf(ActiveCell.EntireColumn, ActiveCell.Value) > 1
Loop
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
Calculate
ActiveCell.Copy
Selection.PasteSpecial Paste:=xlPasteValues
Application.CutCopyMode = False
ActiveCell.Offset(1, 0).Select
Loop Until IsEmpty(ActiveCell.Offset(0, -1))
MsgBox ("Done!")
Range("F1").ClearContents
Else
MsgBox ("Not Allowed!")
End If
Else
MsgBox ("Not Allowed!")
End If
End Sub