ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User Form Template??? (https://www.excelbanter.com/excel-programming/307240-user-form-template.html)

novicevbaer[_4_]

User Form Template???
 
I have to create 60 user forms for an excel project. Is there a way t
create a template so that I don't have to keep changing the individua
user form control properties? Thank you in advance for an
suggestions

--
Message posted from http://www.ExcelForum.com


Harald Staff

User Form Template???
 
Sure. Use the form as a class. Make one witha Label1 and a Commandbutton1
and then run this:

Sub Test()
Dim F1 As UserForm1
Dim F2 As UserForm1
Dim F3 As UserForm1
Dim F4 As UserForm1

Set F1 = New UserForm1
F1.Caption = "Hi"
F1.StartUpPosition = 0
F1.Top = 20
F1.Label1.Caption = "One"
F1.CommandButton1.Caption = "One"

Set F2 = New UserForm1
F2.Caption = "Hi"
F2.BackColor = RGB(230, 250, 150)
F2.Label1.Caption = "Two"
F2.CommandButton1.Caption = "Two"

Set F3 = New UserForm1
F3.Caption = "Hi"
F3.Label1.Caption = "3"
F3.CommandButton1.Caption = "3"

Set F4 = New UserForm1
F4.Caption = "Hi"
F4.Height = 500
F4.Label1.Caption = "Quattro"
F4.CommandButton1.Caption = "Quattro"

F1.Show
F2.Show
F3.Show
F4.Show

End Sub

HTH. Best wishes Harald


"novicevbaer " skrev i melding
...
I have to create 60 user forms for an excel project. Is there a way to
create a template so that I don't have to keep changing the individual
user form control properties? Thank you in advance for any
suggestions.


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 05:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com