generating random number as template

J

Jemm

I need to create a form in excel that generates a unique number for each
form. If anyone can assist with the best way to do this it would be great.
 
M

moi

What you need is a Forms collection object, but in Excel that will only work
for already loaded forms.
So first create the collection yourself, and then browse through it.

Sub CheckFormsInCollection()
Dim i, u As Long, s As String
Load Form1
Load Form2
Load Form3
u = UserForms.Count - 1
For i = u To 0 Step -1
s = s & UserForms(i).Name & vbNewLine
MsgBox s
Next
End Sub
 
Top