Private Sub UserForm_Initialize()
Randomize
Me.TextBox1.Value = CInt(Rnd * 1000000) 'plonk a 6 digit random number in TextBox1 - amend as appropriate
End Sub
Randomize
Me.TextBox1.Value = CLng(Rnd * 1000000) 'plonk a 6 digit random number in TextBox1 - amend as appropriate