Excel - Open a named userform

66 views Asked by At

Sure this is very basic, I had userforms that I had not named and I called these by using UserForm1.Show. Now I have named these eg. ProgressBar.

I call this one by UserForms.Add("ProgressBar").Show vbModeless

But i cant figure out how to make this bit work:

Private Sub UserForm_Initialize()
'With UserForms("ProgressBar")
With Me
  .StartUpPosition = 0
  .Left = Application.Left + (0.5 * Application.Width) - (0.5 * .Width)
  .Top = Application.Top + (0.5 * Application.Height) - (0.5 * .Height)
End With
End Sub

How should I call these forms?

1

There are 1 answers

2
Dan Donoghue On BEST ANSWER

It would just be With ProgressBar as opposed to With UserForms("ProgressBar") wouldn't it?