Hello all,
I write some sloppy VBA, that's why I'm here. I need help with a subroutine to check 6 random numbers for duplicates in the array. Here's what I have so far, but it doesn't work...please help.
The numbers are in K5:P5
Sub sgCheck()
'*** check for duplicates
If "L5" = "K5" Or "M5" = "K5" Or "N5" = "K5" Or "O5" = "K5" Or "P5" = "K5" Then
sgRandom
Else
If "M5" = "L5" Or "N5" = "L5" Or "O5" = "L5" Or "P5" = "L5" Then
sgRandom
Else
If "N5" = "M5" Or "O5" = "M5" Or "P5" = "M5" Then
sgRandom
Else
If "O5" = "N5" Or "P5" = "N5" Then
sgRandom
Else
If "P5" = "O5" Then
sgRandom
End If
End If
End If
End If
End If
End Sub
Steve
I write some sloppy VBA, that's why I'm here. I need help with a subroutine to check 6 random numbers for duplicates in the array. Here's what I have so far, but it doesn't work...please help.
The numbers are in K5:P5
Sub sgCheck()
'*** check for duplicates
If "L5" = "K5" Or "M5" = "K5" Or "N5" = "K5" Or "O5" = "K5" Or "P5" = "K5" Then
sgRandom
Else
If "M5" = "L5" Or "N5" = "L5" Or "O5" = "L5" Or "P5" = "L5" Then
sgRandom
Else
If "N5" = "M5" Or "O5" = "M5" Or "P5" = "M5" Then
sgRandom
Else
If "O5" = "N5" Or "P5" = "N5" Then
sgRandom
Else
If "P5" = "O5" Then
sgRandom
End If
End If
End If
End If
End If
End Sub
Steve