Hello,
I'm attempting to construct a form that will be used a few times each day. Each time the form is opened I want it to include a unique number in cell R3. This number should be MMDDYY-XX where XX is a random two digit number.
I'm a basic VBA user and have come up with the following:
Private Sub Workbook_Open()
Dim curYr, curMo, curDy
curYr = Format(Date, "yy")
curMo = Format(Date, "mm")
curDy = Format(Date, "dd")
NewSubs = curMo & curDy & curYr & "-" & Int(Rnd * 100)
Range("R3").Value = NewSubs
End Sub
This seems to work, except that each time I open the file it has the same two digit random number. Can somebody please explain to me why it isn't generating a new random number each time?
Thanks in advance
Lance
Bookmarks