Hi all,
I've created a userform in the attached document, that works once i've hit "add" twice - can anyone suggest why it's not auto populating on the userform2.show?
Thanks in advance
Hi all,
I've created a userform in the attached document, that works once i've hit "add" twice - can anyone suggest why it's not auto populating on the userform2.show?
Thanks in advance
Last edited by Auxie; 07-04-2017 at 07:32 AM.
Try "Userform_Initialize"
Private Sub UserForm_Initialize() Dim x x = Format(Cells(Rows.Count, 1).End(xlUp).Row - 2, "00") Transmittal2.Value = "704-DT-0" & x DateBox2.Value = Format(Date, "dd/mm/yyy") Originator.Value = "name" Optionbutton1.Value = True Sender.Value = "Name" Description2.Value = "" Media2.Value = "Email" Copies2.Value = "1" Description2.SetFocus End Sub
This doesn't work - I also forgot to add that I've multiple another userform in my master file hence the use of UserForm2 -
I was thinking that its perhaps that I have the other userform loaded but when I've also tried to unload that userform before this one runs, i still get the same result. Its not earth shattering but I would prefer it to auto generate.
Change
Private Sub UserForm2_Activate()
to
Private Sub UserForm_Activate()
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Stepping through the code starting with Userform.Show shows that the Activate macro was not called. For event codes, always use the macro names generated from the Drop-Downs.
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'