Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Question
I have a spreadsheet where I have multiple userforms. On the top of most of these userforms is a summary section that is always the same (includes names, date, and other attributes). Right now, whenever I create a userform I have to add this section and the necessary code for it to work properly. Is there a way to just create the summary section once and then use simple code to add it to the userforms
The way the summary works is that it pulls the name from another worksheet. The user will click on a button on the worksheet and it will pull up the appropriate userform with the summary section at the top. As it is, I have to write code for the button to populate the name,etc fields in the summary section. Here is a copy of the code that I use on the button to bring up the userform Private Sub CommandButton2_Click( 'This is The Lock Butto UserForm13RecaptureLock.Label5.Caption = Sheets("Main").Range("A2").Tex UserForm13RecaptureLock.Label6.Caption = Sheets("Main").Range("B2").Tex UserForm13RecaptureLock.Label7.Caption = Sheets("Main").Range("C2").Tex UserForm13RecaptureLock.Label8.Caption = Sheets("Main").Range("W2").Tex UserForm13RecaptureLock.Sho I am really concerned about the size of the file building up since I have to use this code everytime I create a userform with the summary section. I know there has to be a better way...please someone help me figure it out Rya |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Userform Question
Couldn't you use one userform with a multipage control.
You can hide the tabs in the properties and specify which one is shown as they are indexed. -----Original Message----- I have a spreadsheet where I have multiple userforms. On the top of most of these userforms is a summary section that is always the same (includes names, date, and other attributes). Right now, whenever I create a userform I have to add this section and the necessary code for it to work properly. Is there a way to just create the summary section once and then use simple code to add it to the userforms? The way the summary works is that it pulls the name from another worksheet. The user will click on a button on the worksheet and it will pull up the appropriate userform with the summary section at the top. As it is, I have to write code for the button to populate the name,etc fields in the summary section. Here is a copy of the code that I use on the button to bring up the userform: Private Sub CommandButton2_Click() 'This is The Lock Button UserForm13RecaptureLock.Label5.Caption = Sheets ("Main").Range("A2").Text UserForm13RecaptureLock.Label6.Caption = Sheets ("Main").Range("B2").Text UserForm13RecaptureLock.Label7.Caption = Sheets ("Main").Range("C2").Text UserForm13RecaptureLock.Label8.Caption = Sheets ("Main").Range("W2").Text UserForm13RecaptureLock.Show I am really concerned about the size of the file building up since I have to use this code everytime I create a userform with the summary section. I know there has to be a better way...please someone help me figure it out. Ryan . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Userform question | Excel Discussion (Misc queries) | |||
UserForm Question | Excel Worksheet Functions | |||
UserForm question | Excel Programming | |||
userform question | Excel Programming | |||
userform question | Excel Programming |