ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   UserForm problem when Worksheet is cloned (https://www.excelbanter.com/excel-programming/315597-userform-problem-when-worksheet-cloned.html)

JimP

UserForm problem when Worksheet is cloned
 
To All,

I have a Workbook with many worksheets, 1 sheet which is named
"MASTER".

On the MASTER worksheet I have a USER FORM containing 3 COMMAND
Buttons. Each button launches a macro.

My problem is that 1 of my macros clone's the Master worksheet 1-12
times (by design) and during the cloning process the USER FORM also
gets cloned. This is not terrible, however, there are now Command
Buttons on the cloned sheets UserForm that should be 'ghosted' and
unavailable.

When I clone the MASTER worksheet once I can successfully set:
.Enabled = False
When I clone multiple times, only the last clone is correctly set, all
the other cloned copies have the buttons the same as MASTER's
UserForm.

What am I doing incorrectly?

The following is the Code I run when the MASTER worksheets UserForm
has the Monthly Projection Command Button selected:

'''''''''''''''''''''''''''
Private Sub Monthly_Projection_Button_Click()
Application.ScreenUpdating = True
' SET UserForm buttons to be 'ghosted' prior to Schedule Creation
CreateButton.Enabled = False
Monthly_Projection_Button.Enabled = False
Application.ScreenUpdating = True
MASTER.Hide
If Not CREATE_YEAR_PROJECTION Then
' Projection was aborted ... Restore UserForm buttons
CreateButton.Enabled = True
Monthly_Projection_Button.Enabled = True
End If
End Sub
'''''''''''''''''''''''''''

Any Help would be appreciated ...

Thanks,

JimP

microsoft.public.excel.programming[_3_]

UserForm problem when Worksheet is cloned
 
Took a while ... but problem solved ...

J.Pellechi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 11:07 PM.

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