CheekyDevil2386
New Member
- Joined
- Oct 19, 2020
- Messages
- 6
- Office Version
- 2013
- Platform
- Windows
Hi there!
Is there a simple way to run the below code on multiple, specific pages within a userform multipage?
I want this code to run on pages 1 and 2, but not any others (I have controls on other pages I can't have cleared, so using "userform1.multipage1.controls" isn't an option for me)
Ideally, i would like to have something like:
or similar?
Thank you for any assistance anyone can provide
Is there a simple way to run the below code on multiple, specific pages within a userform multipage?
I want this code to run on pages 1 and 2, but not any others (I have controls on other pages I can't have cleared, so using "userform1.multipage1.controls" isn't an option for me)
VBA Code:
Dim oneControl As Object
For Each oneControl In MultiPage1.Pages(2).Controls
Select Case TypeName(oneControl)
Case "TextBox"
oneControl.Text = vbNullString
Case "CheckBox"
oneControl.Value = False
End Select
Next oneControl
Ideally, i would like to have something like:
VBA Code:
For Each oneControl In MultiPage1.Pages(1+2).Controls
or similar?
Thank you for any assistance anyone can provide