Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Excel V2003
On a worksheet I have many buttons where each represents an item. I click one of the worksheet buttons to make a user form display. The form contains only read-information about the product and a few form buttons that expand the form for more details (the form features no input elements). While the form is displayed I would like to click another sheet button to have a second form display just like the first but with different data population and display without the first form closing. I may have to display one or several like forms with the ability to then close them individually or all at once. I'm pretty sure I can do all that, but the whopper is I'd like to do this by building just one form because I have need for a hundred such small forms to show. I'd rather not have to build, assign, and manage that many forms. So, is there any way one form can somehow be replicated or used as a template so that many instances of the same form can be displayed simultaneously? If not, can anyone recommend another strategy? Thanks, Melina |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Create a form (I presume you actually have one already designed), and you can
create new instances of it with code similar to this, where you'd have one Sub per button to open a form for a specific purpose. Lets say the name of your 'template' user form is myUserFormTemplate Sub Button1_Click() Dim myUserForm As Object Set myUserForm as New myUserFormTemplate 'continue to customize the form here End Sub Sub Button2_Click() Dim myUserForm As Object Set myUserForm as New myUserFormTemplate 'continue to customize the form here End Sub Play with it all some, I'm sure there are others sharper in this area than I am that will jump in with other hints and suggestions also. "Mel" wrote: Excel V2003 On a worksheet I have many buttons where each represents an item. I click one of the worksheet buttons to make a user form display. The form contains only read-information about the product and a few form buttons that expand the form for more details (the form features no input elements). While the form is displayed I would like to click another sheet button to have a second form display just like the first but with different data population and display without the first form closing. I may have to display one or several like forms with the ability to then close them individually or all at once. I'm pretty sure I can do all that, but the whopper is I'd like to do this by building just one form because I have need for a hundred such small forms to show. I'd rather not have to build, assign, and manage that many forms. So, is there any way one form can somehow be replicated or used as a template so that many instances of the same form can be displayed simultaneously? If not, can anyone recommend another strategy? Thanks, Melina |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I haven't had time to try it yet, but I will tonight and reply.
Thanks. -Melina On Sep 8, 11:01*pm, JLatham <HelpFrom @ Jlathamsite.com.(removethis) wrote: Create a form (I presume you actually have one already designed), and you can create new instances of it with code similar to this, where you'd have one Sub per button to open a form for a specific purpose. *Lets say the name of your 'template' user form is myUserFormTemplate Sub Button1_Click() * Dim myUserForm As Object * Set myUserForm as New myUserFormTemplate 'continue to customize the form here End Sub Sub Button2_Click() * Dim myUserForm As Object * Set myUserForm as New myUserFormTemplate 'continue to customize the form here End Sub Play with it all some, I'm sure there are others sharper in this area than I am that will jump in with other hints and suggestions also. "Mel" wrote: Excel V2003 On a worksheet I have many buttons where each represents an item. I click one of the worksheet buttons to make a user form display. The form contains only read-information about the product and a few form buttons that expand the form for more details (the form features no input elements). While the form is displayed I would like to click another sheet button to have a second form display just like the first but with different data population and display without the first form closing. I may have to display one or several like forms with the ability to then close them individually or all at once. I'm pretty sure I can do all that, but the whopper is I'd like to do this by building just one form because I have need for a hundred such small forms to show. I'd rather not have to build, assign, and manage that many forms. So, is there any way one form can somehow be replicated or used as a template so that many instances of the same form can be displayed simultaneously? If not, can anyone recommend another strategy? Thanks, Melina |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Question regarding UserForm | Excel Discussion (Misc queries) | |||
UserForm question | Excel Programming | |||
userform question | Excel Programming | |||
UserForm Question | Excel Programming | |||
userform question | Excel Programming |