ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Showing userform (https://www.excelbanter.com/excel-programming/387429-showing-userform.html)

WLMPilot

Showing userform
 
I have a workbook with three worksheets (INTRO, ORDER, ITEMS). The meat of
the workbook is with Orders, and I have everything working correctly on that
sheet. However, I need a userform that is used on ORDERS to be displayed on
INTRO when the workbook is opened or when the INTRO page is clicked on, ie
becomes active sheet. The INTRO sheet is used for the sole purpose of
providing instructions for the various sections used on worksheet ORDERS.

The userform name that I need is "itemqty"

Thanks,
Les


JLGWhiz

Showing userform
 
If the UserForm for Sheet("ORDERS") is in the same workbook as sheet("INTRO")
then in the sheet("INTRO") code module use:

Private Sub Worksheet_Activate()
itemqty.Show
End Sub

You will need to do a Unload itemqty somewhere in your code to remove the
form when you have finished with it.

You also need to ensure that the underlying code of the UserForm and it's
controls will operate properly from the different worksheet.

If the two sheets are in different workbooks, then you will have to copy the
form from the VBA module of one workbook to the VBA module of the different
workbook and then enter the code as described above.

"WLMPilot" wrote:

I have a workbook with three worksheets (INTRO, ORDER, ITEMS). The meat of
the workbook is with Orders, and I have everything working correctly on that
sheet. However, I need a userform that is used on ORDERS to be displayed on
INTRO when the workbook is opened or when the INTRO page is clicked on, ie
becomes active sheet. The INTRO sheet is used for the sole purpose of
providing instructions for the various sections used on worksheet ORDERS.

The userform name that I need is "itemqty"

Thanks,
Les


WLMPilot

Showing userform
 
Thanks, I will give it a try. All sheets are in the same workbook. Is
there any way to take a snapshot of the userform and display it on the other
sheet? As for unloading, I can do so via the command button that is clicked
to start the order process. However, is one switches between pages via the
sheet tabs at the bottom, I don' t know how to unload when leaving the INTRO
sheet.

Thanks,
Les

"JLGWhiz" wrote:

If the UserForm for Sheet("ORDERS") is in the same workbook as sheet("INTRO")
then in the sheet("INTRO") code module use:

Private Sub Worksheet_Activate()
itemqty.Show
End Sub

You will need to do a Unload itemqty somewhere in your code to remove the
form when you have finished with it.

You also need to ensure that the underlying code of the UserForm and it's
controls will operate properly from the different worksheet.

If the two sheets are in different workbooks, then you will have to copy the
form from the VBA module of one workbook to the VBA module of the different
workbook and then enter the code as described above.

"WLMPilot" wrote:

I have a workbook with three worksheets (INTRO, ORDER, ITEMS). The meat of
the workbook is with Orders, and I have everything working correctly on that
sheet. However, I need a userform that is used on ORDERS to be displayed on
INTRO when the workbook is opened or when the INTRO page is clicked on, ie
becomes active sheet. The INTRO sheet is used for the sole purpose of
providing instructions for the various sections used on worksheet ORDERS.

The userform name that I need is "itemqty"

Thanks,
Les


JLGWhiz

Showing userform
 
Well, you have me a little bit confused. Your underlying code tells the
UserForm when to appear. It can be made to appear while any sheet is in the
active window and it can be made to unload or hide in the same circumstances.
It is not tied directly to a particular worksheet as a member of the
worksheet collection. It is controlled solely by VB code. The button you
refer to for unloading the form would have to have underlying code that
initiates the unload command. If the button only shows on sheet(INTRO),
then right click on it and see if you can copy it to the sheet the other
sheet you want the form to show up on. It should copy the code right along
with it so you can unload the form from that sheet also.

"WLMPilot" wrote:

Thanks, I will give it a try. All sheets are in the same workbook. Is
there any way to take a snapshot of the userform and display it on the other
sheet? As for unloading, I can do so via the command button that is clicked
to start the order process. However, is one switches between pages via the
sheet tabs at the bottom, I don' t know how to unload when leaving the INTRO
sheet.

Thanks,
Les

"JLGWhiz" wrote:

If the UserForm for Sheet("ORDERS") is in the same workbook as sheet("INTRO")
then in the sheet("INTRO") code module use:

Private Sub Worksheet_Activate()
itemqty.Show
End Sub

You will need to do a Unload itemqty somewhere in your code to remove the
form when you have finished with it.

You also need to ensure that the underlying code of the UserForm and it's
controls will operate properly from the different worksheet.

If the two sheets are in different workbooks, then you will have to copy the
form from the VBA module of one workbook to the VBA module of the different
workbook and then enter the code as described above.

"WLMPilot" wrote:

I have a workbook with three worksheets (INTRO, ORDER, ITEMS). The meat of
the workbook is with Orders, and I have everything working correctly on that
sheet. However, I need a userform that is used on ORDERS to be displayed on
INTRO when the workbook is opened or when the INTRO page is clicked on, ie
becomes active sheet. The INTRO sheet is used for the sole purpose of
providing instructions for the various sections used on worksheet ORDERS.

The userform name that I need is "itemqty"

Thanks,
Les



All times are GMT +1. The time now is 06:25 PM.

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