Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Default ribbon to open by default when opening xls in browser | Excel Discussion (Misc queries) | |||
Multipage - default to particular page | Excel Programming | |||
How To Open First Worksheet By Default? | Excel Discussion (Misc queries) | |||
can you set a default page in a Multipage userform? | Excel Programming | |||
Qn: Setting MultiPage page default??? | Excel Programming |