View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sean Sean is offline
external usenet poster
 
Posts: 208
Default I don't want to repeat the same number

how can I change a repeating number?
this is what I have so far.
Thank you!

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
A = Cells(1, 1) + 2
Dim Rw, Col
Rw = Target.Row: Col = Target.Column
If Col < 2 Then Exit Sub
If Rw < 3 Or Rw A Then Exit Sub
If Cells(Rw, Col) = Cells(Rw, Col) Then
Cells(Rw, Col) = Int((A * Rnd) + 1)
Else: Exit Sub
End If
End Sub