• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Userform names

roraima07

New Member
Hi!

I found a neat routine to list the names of all of the controls (frame captions, labels, text fields, etc.) on a userform. Now I wish to pass a list of the userforms in my workbook to this routine. Their names have been changed from the default Userform1, Userform2, etc.

In the Properties pane of the userform, the Name property is enclosed in parentheses, and I am unable to use .Name as I could other properties such as .BackColor.

Is there a way to send a list of userforms to a routine in the manner I described above? Any assistance would be sincerely appreciated.

Thanks.

DRP
 
Hi ,

I tried out what you have posted , and even after changing the name of the form from Userform1 to Sampleform , I am able to use both of the following :

Sampleform.Name

Userforms(0).Name

What exactly is your problem ?

Narayan
 
Hello Narayan:

Let's say I have three forms named frmSales, frmRevenue, and frmEmployeeData. What I want is to be able to use a variable (an array maybe?) to iterate through the list of forms and report all the controls on them without having to specify each form's name explicitly.

Something like:

For Each form in listOfForms
' list the names of all of the controls, writing them out to a worksheet, one column per form​
Next form​

Thanks for your reply.

DRP
 
Back
Top