deadfishsurfer
New Member
- Joined
- Mar 12, 2015
- Messages
- 6
Hi
I am using a 2 codes that i had modded for me:
the first is
Sub Button3_Click()
Dim i As Long
For i = 9 To 18
Range("B7" & i) = RND()
Next i
End Sub
the second one is
Sub myRnd()
Dim myOrder As Range
Dim myName
Dim mySelect As Variant
Randomize
mySelect = Int((19 * RND) + 1)
myName = Range("J" & mySelect)
Worksheets("Sheet1").Range("B4") = myName
End Sub
it all works fine, i click the button and it all goes fine
but after the random data is generated whenever i edit, or leave any other cell the code runs again without any prompt changing the random data to new random data
how can i adjust this so it will only happen when the button is clicked ?
Hope someone can help
I am using a 2 codes that i had modded for me:
the first is
Sub Button3_Click()
Dim i As Long
For i = 9 To 18
Range("B7" & i) = RND()
Next i
End Sub
the second one is
Sub myRnd()
Dim myOrder As Range
Dim myName
Dim mySelect As Variant
Randomize
mySelect = Int((19 * RND) + 1)
myName = Range("J" & mySelect)
Worksheets("Sheet1").Range("B4") = myName
End Sub
it all works fine, i click the button and it all goes fine
but after the random data is generated whenever i edit, or leave any other cell the code runs again without any prompt changing the random data to new random data
how can i adjust this so it will only happen when the button is clicked ?
Hope someone can help