Defining UserForm Caption from a Variable

H

Hendy88

Hello all mighty Excel gurus!

I was wondering if it's possible to pass a variable in when showing a
userform to set the caption. I have made UserForm1 and based on a
variable set earlier in the macro I want to be able to assign a
"caption". Obviously I can set it in the Properties by clicking the
Caption setting and typing anything I want. But can I do something
like this (and pardon the "fantasy" code):

Dim FormName as String
FormName = Range("A1").Value

UserForm.show Caption:=FormName

Is something like that possible? Can I send in a predefined variable
to set the caption on the fly when it opens (shows) the UserForm?

Thanks!
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top