Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Userform question

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,365
Default Userform question

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Userform question

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Question regarding UserForm TotallyConfused Excel Discussion (Misc queries) 0 September 3rd 09 09:38 PM
UserForm question Matt[_48_] Excel Programming 2 June 23rd 07 06:50 AM
userform question Peterke Excel Programming 0 March 25th 06 08:46 PM
UserForm Question Sharon Excel Programming 7 March 30th 05 05:48 PM
userform question Rob Bovey Excel Programming 0 August 25th 03 11:43 PM


All times are GMT +1. The time now is 10:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"