why it will error when i click my assigned macro to initialize userform ??

Jefferson2512

Board Regular
Joined
Sep 16, 2019
Messages
53
Code:
Private Sub UserForm_Initialize()
    


    Me.MultiPage7.Value = 0
    Me.MultiPage1.Value = 0
    Me.MultiPage2.Value = 0
    Me.MultiPage3.Value = 0
    Me.MultiPage5.Value = 0
    Me.MultiPage6.Value = 0
 End Sub
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
So your saying you have 7 Multipages ?

I think you may have 1 Multipage with 7 Pages.
 
Upvote 0
I have b een using Excel for years and never needed more then One Multipage

A Multipage is like a Workbook.
And your Multipage can have several Multipage pages

Just like a Workbook can have several Worksheets.

You seem to be posting scripts that do not work with no explanation of what your attempting to do.

I would eliminate it to One Multipage and test things out before trying to do all 7
 
Upvote 0
I have b een using Excel for years and never needed more then One Multipage

A Multipage is like a Workbook.
And your Multipage can have several Multipage pages

Just like a Workbook can have several Worksheets.

You seem to be posting scripts that do not work with no explanation of what your attempting to do.

I would eliminate it to One Multipage and test things out before trying to do all 7

Sir, the reason why i have 7 multipages because in every tabs that multipage have i put another multipage to have another tabs inside the first multipage
 
Upvote 0
I have no answer. The script you provided should work if you have 7 Multipages.
 
Upvote 0
How many 'tabs/pages' do you need?
 
Upvote 0
Code:
Private Sub UserForm_Initialize()
    


    Me.MultiPage7.Value = 0
    Me.MultiPage1.Value = 0
    Me.MultiPage2.Value = 0
    Me.MultiPage3.Value = 0
    Me.MultiPage5.Value = 0
    Me.MultiPage6.Value = 0
 End Sub

Try it this way & see if resolves

Code:
Private Sub UserForm_Initialize()
    Dim ctrl As Control
    For Each ctrl In Me.Controls
       If TypeName(ctrl) = "MultiPage" Then ctrl.Value = 0
    Next
 End Sub

Dave
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,224
Members
452,620
Latest member
dsubash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top