I'm wondering how to avoid having to type out 'End With' after each with statement. Can anyone help?
Here's my code below:
Private Sub UserForm_Initialize()
'Start Userform Centered inside Excel Screen (for dual monitors)
Me.StartUpPosition = 0
Me.Left = Application.Left + (0.5 * Application.Width) - (0.5 * Me.Width)
Me.Top = Application.Top + (0.5 * Application.Height) - (0.5 * Me.Height)
'Declares the value in the date box
DateD.Value = Format(Date, "dd/mm/yyyy")
'With Statements declare the values in each of the list boxes
With TrainingType
.additem ""
With Trainer
.additem ""
With Team
.additem ""
With Stream
.additem ""
With Trainer
.additem ""
End With
End With
End With
End With
End With
End Sub
Here's my code below:
Private Sub UserForm_Initialize()
'Start Userform Centered inside Excel Screen (for dual monitors)
Me.StartUpPosition = 0
Me.Left = Application.Left + (0.5 * Application.Width) - (0.5 * Me.Width)
Me.Top = Application.Top + (0.5 * Application.Height) - (0.5 * Me.Height)
'Declares the value in the date box
DateD.Value = Format(Date, "dd/mm/yyyy")
'With Statements declare the values in each of the list boxes
With TrainingType
.additem ""
With Trainer
.additem ""
With Team
.additem ""
With Stream
.additem ""
With Trainer
.additem ""
End With
End With
End With
End With
End With
End Sub