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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
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,224,823
Messages
6,181,169
Members
453,021
Latest member
Justyna P

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