Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Multipage default open

Hi,

I am trying to set a default opening page for the multipage on a userform.
When I use:

Private Sub MultiPage1_Change()
UserForm1.MultiPage1.Value = 0
End Sub

OR

Private Sub MultiPage1_Change()
MultiPage1.Value = 0
End Sub

The dafult still does not work and it causes the labelling tabs to not work
correctly. I have to click it twice, 1st changes the tab appearnce 2nd
changes the actual page.
I would simply like it to always open on the first page.

Thanks in advance,
Matt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multipage default open


Your code is basically correct, but it should be in the initialise event
of the userform

Code:
--------------------

Private Sub UserForm_Initialize()
'note page numbers start from 0
Me.MultiPage1.Value = 1
End Sub
--------------------


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site
' (http://www.excel-it.com)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=33777

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Multipage default open

I tried that but came up with the same problem. Here is the complete codes
assocaited with opening the userform. I also have this linked to a command
button to start it, if that matters. I have tried inserting the line
regarding multipage value=0 in the first Sub section. That hasn't helped
either. This is my first userform so I assume it is a beginner mistake.

Thanks for your time,
Clint


Option Explicit
Sub OpenUserfrm1()
UserForm1.Show
End Sub

Private Sub UserForm_Initialize()
'note page numbers start from 0
Me.MultiPage1.Value = 0
End Sub





"royUK" wrote:


Your code is basically correct, but it should be in the initialise event
of the userform

Code:
--------------------

Private Sub UserForm_Initialize()
'note page numbers start from 0
Me.MultiPage1.Value = 1
End Sub
--------------------


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site
' (http://www.excel-it.com)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=33777


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multipage default open


Have you put the code in the userform module?


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site
' (http://www.excel-it.com)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=33777

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Multipage default open

I don't think you want to be using the Change event. You can specify
the default opening page in the designer's Properties window for the
MultiPage by changing the Value property Or, you can do it with code
when the form is loaded.

Private Sub UserForm_Initialize()
With Me.MultiPage1
.Value = 1 ' 0-based. Page1=0, Page2=1, etc
End With
End Sub

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Tue, 25 Nov 2008 06:36:16 -0800, Whois Clinton
wrote:

Hi,

I am trying to set a default opening page for the multipage on a userform.
When I use:

Private Sub MultiPage1_Change()
UserForm1.MultiPage1.Value = 0
End Sub

OR

Private Sub MultiPage1_Change()
MultiPage1.Value = 0
End Sub

The dafult still does not work and it causes the labelling tabs to not work
correctly. I have to click it twice, 1st changes the tab appearnce 2nd
changes the actual page.
I would simply like it to always open on the first page.

Thanks in advance,
Matt



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Multipage default open

I tried adding the code in with the initializing code.
ORIGINAL OPENING CODE

Option Explicit
Sub OpenUserfrm1()
UserForm1.Show
End Sub

Tried to add as follows:
Option Explicit
Sub OpenUserfrm1()
UserForm1.Show
End Sub
Private Sub UserForm_Initialize()
With Me.MultiPage1.Value = 1 ' 0-based. Page1=0, Page2=1, etc
End With
End Sub

That is not working either. Nor is adding the code in the set below which
controls the tools on the form. What am I missing?


Option Explicit

Private Sub CommandButton2_Click()
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
comboxResidentialList.Value = "Choose from below"

UserForm1.Hide
End Sub

Private Sub Commandbutton1_click()

Range("A1").Value = TextBox1.Value
Range("B1").Value = TextBox2.Value
Range("C1").Value = TextBox3.Value
Range("D1").Value = comboxResidentialList.Value
TextBox1.Value = ""
TextBox2.Value = ""
TextBox3.Value = ""
comboxResidentialList.Value = "Choose from below"
UserForm1.Hide

End Sub
Private Sub ListBox1_Click()

End Sub
Private Sub MultiPage1_Change()

End Sub

Private Sub UserForm_Click()

End Sub





"Chip Pearson" wrote:

I don't think you want to be using the Change event. You can specify
the default opening page in the designer's Properties window for the
MultiPage by changing the Value property Or, you can do it with code
when the form is loaded.

Private Sub UserForm_Initialize()
With Me.MultiPage1
.Value = 1 ' 0-based. Page1=0, Page2=1, etc
End With
End Sub

Cordially,
Chip Pearson
Microsoft MVP
Excel Product Group
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Tue, 25 Nov 2008 06:36:16 -0800, Whois Clinton
wrote:

Hi,

I am trying to set a default opening page for the multipage on a userform.
When I use:

Private Sub MultiPage1_Change()
UserForm1.MultiPage1.Value = 0
End Sub

OR

Private Sub MultiPage1_Change()
MultiPage1.Value = 0
End Sub

The dafult still does not work and it causes the labelling tabs to not work
correctly. I have to click it twice, 1st changes the tab appearnce 2nd
changes the actual page.
I would simply like it to always open on the first page.

Thanks in advance,
Matt


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multipage default open


This code should be in the actual userform.

In the VB Editor Properties you can see the form. Double click on it to
access the form as if you were adding controls.

Next double click on the actual form to access it's events. In the left
hand drop down find Initialize. That's where you need to paste the code


Code:
--------------------
Private Sub UserForm_Initialize()
With Me.MultiPage1.Value = 1 ' 0-based. Page1=0, Page2=1, etc
End With
End Sub
--------------------


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site
' (http://www.excel-it.com)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=33777

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Multipage default open

THanks Roy that got me to the right spot but now returns:

Compile error:
With object must be user-defined type, Object, or Variant


"royUK" wrote:


This code should be in the actual userform.

In the VB Editor Properties you can see the form. Double click on it to
access the form as if you were adding controls.

Next double click on the actual form to access it's events. In the left
hand drop down find Initialize. That's where you need to paste the code


Code:
--------------------
Private Sub UserForm_Initialize()
With Me.MultiPage1.Value = 1 ' 0-based. Page1=0, Page2=1, etc
End With
End Sub
--------------------


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site
' (http://www.excel-it.com)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=33777


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Multipage default open


Lost a carriage return somewhere, should be



Code:
--------------------
Private Sub UserForm_Initialize()
With Me
.MultiPage1.Value = 1 ' 0-based. Page1=0, Page2=1, etc
End With
End Sub
--------------------


or

Code:
--------------------

Private Sub UserForm_Initialize()
'note page numbers start from 0, so this will open page 2
Me.MultiPage1.Value = 1
End Sub
--------------------


--
royUK

Hope that helps, RoyUK
For tips & examples visit my 'web site
' (http://www.excel-it.com)
------------------------------------------------------------------------
royUK's Profile: http://www.thecodecage.com/forumz/member.php?userid=15
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=33777

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default ribbon to open by default when opening xls in browser Hank Excel Discussion (Misc queries) 0 April 10th 08 10:12 PM
Multipage - default to particular page Clayman Excel Programming 3 June 25th 07 03:08 PM
How To Open First Worksheet By Default? Arif Excel Discussion (Misc queries) 3 August 1st 06 10:11 AM
can you set a default page in a Multipage userform? Trefor Excel Programming 2 April 5th 06 08:28 AM
Qn: Setting MultiPage page default??? Michael Vaughan Excel Programming 2 August 27th 04 07:30 PM


All times are GMT +1. The time now is 09:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"