Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi All,
I was wondering if there was anyone out there who can help me? I have a worksheet with Group names populated in Coloumn "A" A B 1 Group1 Value 1 2 Group2 Value 2 etc the cell "A1" has a name defined as "Start" I have wirtten come code that will allow this list to expand as required ie. more groups are added. and another piece that will display a form with a multipage create a new page for each entry in coloum "A". with the group name as the caption. Now I am stuck.... I cannot work out how to add a textbox to each of the pages as it is created. The idea being that the box will display the data contained in coloumn "B" Having consulted the "Help" file I am now totally confused especially as the code provided within does not seem to work when I create the example. The code I am using is as follows Sub test() Dim name As String Dim counter As Integer counter = 0 Range("start").Select Do Until ActiveCell = "" Range("offset(start," & counter & ",0)").Select If ActiveCell < "" Then name = ActiveCell UserForm1.MultiPage1.Pages.Add (name) ' ' Code to set up pages goes here (I think) ' ' End If counter = counter + 1 Loop UserForm1.Show End Sub Can anyone Help me please??? Regards and Thanks Mick |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is this what you want
Dim sName As String Dim counter As Integer Dim oMP As MultiPage Dim NewButton As MSForms.TextBox counter = 0 Set oMP = UserForm1.MultiPage1 With Range("start") Do Until .Offset(counter, 0).Value = "" sName = .Offset(counter, 0).Value If counter < 2 Then oMP.Pages(counter).Caption = sName Else oMP.Pages.Add (sName) End If Set NewButton = oMP.Pages(counter).Controls.Add("Forms.Textbox.1") NewButton.name = "txt" & sName NewButton.Text = .Offset(counter, 1).Value NewButton.Left = 20 NewButton.Top = 20 counter = counter + 1 Loop End With UserForm1.Show -- HTH Bob Phillips (remove nothere from email address if mailing direct) "michael fuller" wrote in message ... Hi All, I was wondering if there was anyone out there who can help me? I have a worksheet with Group names populated in Coloumn "A" A B 1 Group1 Value 1 2 Group2 Value 2 etc the cell "A1" has a name defined as "Start" I have wirtten come code that will allow this list to expand as required ie. more groups are added. and another piece that will display a form with a multipage create a new page for each entry in coloum "A". with the group name as the caption. Now I am stuck.... I cannot work out how to add a textbox to each of the pages as it is created. The idea being that the box will display the data contained in coloumn "B" Having consulted the "Help" file I am now totally confused especially as the code provided within does not seem to work when I create the example. The code I am using is as follows Sub test() Dim name As String Dim counter As Integer counter = 0 Range("start").Select Do Until ActiveCell = "" Range("offset(start," & counter & ",0)").Select If ActiveCell < "" Then name = ActiveCell UserForm1.MultiPage1.Pages.Add (name) ' ' Code to set up pages goes here (I think) ' ' End If counter = counter + 1 Loop UserForm1.Show End Sub Can anyone Help me please??? Regards and Thanks Mick |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob,
Thanks for the reply. Unfortunatly I get an "Invalid procedure call or argument" error with the following line oMP.Pages(counter).Caption = sName I am using Excel 2000... would this account for the error? Regards and Thanks Mick "Bob Phillips" wrote in message ... Is this what you want Dim sName As String Dim counter As Integer Dim oMP As MultiPage Dim NewButton As MSForms.TextBox counter = 0 Set oMP = UserForm1.MultiPage1 With Range("start") Do Until .Offset(counter, 0).Value = "" sName = .Offset(counter, 0).Value If counter < 2 Then oMP.Pages(counter).Caption = sName Else oMP.Pages.Add (sName) End If Set NewButton = oMP.Pages(counter).Controls.Add("Forms.Textbox.1") NewButton.name = "txt" & sName NewButton.Text = .Offset(counter, 1).Value NewButton.Left = 20 NewButton.Top = 20 counter = counter + 1 Loop End With UserForm1.Show -- HTH Bob Phillips (remove nothere from email address if mailing direct) "michael fuller" wrote in message ... Hi All, I was wondering if there was anyone out there who can help me? I have a worksheet with Group names populated in Coloumn "A" A B 1 Group1 Value 1 2 Group2 Value 2 etc the cell "A1" has a name defined as "Start" I have wirtten come code that will allow this list to expand as required ie. more groups are added. and another piece that will display a form with a multipage create a new page for each entry in coloum "A". with the group name as the caption. Now I am stuck.... I cannot work out how to add a textbox to each of the pages as it is created. The idea being that the box will display the data contained in coloumn "B" Having consulted the "Help" file I am now totally confused especially as the code provided within does not seem to work when I create the example. The code I am using is as follows Sub test() Dim name As String Dim counter As Integer counter = 0 Range("start").Select Do Until ActiveCell = "" Range("offset(start," & counter & ",0)").Select If ActiveCell < "" Then name = ActiveCell UserForm1.MultiPage1.Pages.Add (name) ' ' Code to set up pages goes here (I think) ' ' End If counter = counter + 1 Loop UserForm1.Show End Sub Can anyone Help me please??? Regards and Thanks Mick |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Mick,
I have just loaded up Excel 2000 and that code works fine for me there. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "michael fuller" wrote in message ... Hi Bob, Thanks for the reply. Unfortunatly I get an "Invalid procedure call or argument" error with the following line oMP.Pages(counter).Caption = sName I am using Excel 2000... would this account for the error? Regards and Thanks Mick "Bob Phillips" wrote in message ... Is this what you want Dim sName As String Dim counter As Integer Dim oMP As MultiPage Dim NewButton As MSForms.TextBox counter = 0 Set oMP = UserForm1.MultiPage1 With Range("start") Do Until .Offset(counter, 0).Value = "" sName = .Offset(counter, 0).Value If counter < 2 Then oMP.Pages(counter).Caption = sName Else oMP.Pages.Add (sName) End If Set NewButton = oMP.Pages(counter).Controls.Add("Forms.Textbox.1") NewButton.name = "txt" & sName NewButton.Text = .Offset(counter, 1).Value NewButton.Left = 20 NewButton.Top = 20 counter = counter + 1 Loop End With UserForm1.Show -- HTH Bob Phillips (remove nothere from email address if mailing direct) "michael fuller" wrote in message ... Hi All, I was wondering if there was anyone out there who can help me? I have a worksheet with Group names populated in Coloumn "A" A B 1 Group1 Value 1 2 Group2 Value 2 etc the cell "A1" has a name defined as "Start" I have wirtten come code that will allow this list to expand as required ie. more groups are added. and another piece that will display a form with a multipage create a new page for each entry in coloum "A". with the group name as the caption. Now I am stuck.... I cannot work out how to add a textbox to each of the pages as it is created. The idea being that the box will display the data contained in coloumn "B" Having consulted the "Help" file I am now totally confused especially as the code provided within does not seem to work when I create the example. The code I am using is as follows Sub test() Dim name As String Dim counter As Integer counter = 0 Range("start").Select Do Until ActiveCell = "" Range("offset(start," & counter & ",0)").Select If ActiveCell < "" Then name = ActiveCell UserForm1.MultiPage1.Pages.Add (name) ' ' Code to set up pages goes here (I think) ' ' End If counter = counter + 1 Loop UserForm1.Show End Sub Can anyone Help me please??? Regards and Thanks Mick |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hmmm... I wonder if there is an Add in that I should be using then?
"Bob Phillips" wrote in message ... Mick, I have just loaded up Excel 2000 and that code works fine for me there. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "michael fuller" wrote in message ... Hi Bob, Thanks for the reply. Unfortunatly I get an "Invalid procedure call or argument" error with the following line oMP.Pages(counter).Caption = sName I am using Excel 2000... would this account for the error? Regards and Thanks Mick "Bob Phillips" wrote in message ... Is this what you want Dim sName As String Dim counter As Integer Dim oMP As MultiPage Dim NewButton As MSForms.TextBox counter = 0 Set oMP = UserForm1.MultiPage1 With Range("start") Do Until .Offset(counter, 0).Value = "" sName = .Offset(counter, 0).Value If counter < 2 Then oMP.Pages(counter).Caption = sName Else oMP.Pages.Add (sName) End If Set NewButton = oMP.Pages(counter).Controls.Add("Forms.Textbox.1") NewButton.name = "txt" & sName NewButton.Text = .Offset(counter, 1).Value NewButton.Left = 20 NewButton.Top = 20 counter = counter + 1 Loop End With UserForm1.Show -- HTH Bob Phillips (remove nothere from email address if mailing direct) "michael fuller" wrote in message ... Hi All, I was wondering if there was anyone out there who can help me? I have a worksheet with Group names populated in Coloumn "A" A B 1 Group1 Value 1 2 Group2 Value 2 etc the cell "A1" has a name defined as "Start" I have wirtten come code that will allow this list to expand as required ie. more groups are added. and another piece that will display a form with a multipage create a new page for each entry in coloum "A". with the group name as the caption. Now I am stuck.... I cannot work out how to add a textbox to each of the pages as it is created. The idea being that the box will display the data contained in coloumn "B" Having consulted the "Help" file I am now totally confused especially as the code provided within does not seem to work when I create the example. The code I am using is as follows Sub test() Dim name As String Dim counter As Integer counter = 0 Range("start").Select Do Until ActiveCell = "" Range("offset(start," & counter & ",0)").Select If ActiveCell < "" Then name = ActiveCell UserForm1.MultiPage1.Pages.Add (name) ' ' Code to set up pages goes here (I think) ' ' End If counter = counter + 1 Loop UserForm1.Show End Sub Can anyone Help me please??? Regards and Thanks Mick |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Why don't you post me your workbook to look at?
-- HTH Bob Phillips (remove nothere from email address if mailing direct) "Michael Fuller" wrote in message ... Hmmm... I wonder if there is an Add in that I should be using then? "Bob Phillips" wrote in message ... Mick, I have just loaded up Excel 2000 and that code works fine for me there. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "michael fuller" wrote in message ... Hi Bob, Thanks for the reply. Unfortunatly I get an "Invalid procedure call or argument" error with the following line oMP.Pages(counter).Caption = sName I am using Excel 2000... would this account for the error? Regards and Thanks Mick "Bob Phillips" wrote in message ... Is this what you want Dim sName As String Dim counter As Integer Dim oMP As MultiPage Dim NewButton As MSForms.TextBox counter = 0 Set oMP = UserForm1.MultiPage1 With Range("start") Do Until .Offset(counter, 0).Value = "" sName = .Offset(counter, 0).Value If counter < 2 Then oMP.Pages(counter).Caption = sName Else oMP.Pages.Add (sName) End If Set NewButton = oMP.Pages(counter).Controls.Add("Forms.Textbox.1") NewButton.name = "txt" & sName NewButton.Text = .Offset(counter, 1).Value NewButton.Left = 20 NewButton.Top = 20 counter = counter + 1 Loop End With UserForm1.Show -- HTH Bob Phillips (remove nothere from email address if mailing direct) "michael fuller" wrote in message ... Hi All, I was wondering if there was anyone out there who can help me? I have a worksheet with Group names populated in Coloumn "A" A B 1 Group1 Value 1 2 Group2 Value 2 etc the cell "A1" has a name defined as "Start" I have wirtten come code that will allow this list to expand as required ie. more groups are added. and another piece that will display a form with a multipage create a new page for each entry in coloum "A". with the group name as the caption. Now I am stuck.... I cannot work out how to add a textbox to each of the pages as it is created. The idea being that the box will display the data contained in coloumn "B" Having consulted the "Help" file I am now totally confused especially as the code provided within does not seem to work when I create the example. The code I am using is as follows Sub test() Dim name As String Dim counter As Integer counter = 0 Range("start").Select Do Until ActiveCell = "" Range("offset(start," & counter & ",0)").Select If ActiveCell < "" Then name = ActiveCell UserForm1.MultiPage1.Pages.Add (name) ' ' Code to set up pages goes here (I think) ' ' End If counter = counter + 1 Loop UserForm1.Show End Sub Can anyone Help me please??? Regards and Thanks Mick |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Progmatically adding controls in multipage | Excel Programming | |||
need help understanding syntax for adding a page to multipage | Excel Programming | |||
Multipage & Spinbutton controls on a form | Excel Programming | |||
how to put a reference from a page of a multipage form to another page | Excel Programming | |||
Can I set a page of a Multipage form to active? | Excel Programming |