Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Adding controls to each page in a multipage form

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Adding controls to each page in a multipage form

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Adding controls to each page in a multipage form

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Adding controls to each page in a multipage form

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Adding controls to each page in a multipage form

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Adding controls to each page in a multipage form

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
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
Progmatically adding controls in multipage Ajit Excel Programming 0 January 4th 05 09:39 PM
need help understanding syntax for adding a page to multipage GregJG[_11_] Excel Programming 9 July 10th 04 11:20 AM
Multipage & Spinbutton controls on a form Bhuktar S Excel Programming 1 April 21st 04 01:50 PM
how to put a reference from a page of a multipage form to another page Valeria[_2_] Excel Programming 2 January 25th 04 08:21 AM
Can I set a page of a Multipage form to active? John T Ingato Excel Programming 2 October 11th 03 12:15 AM


All times are GMT +1. The time now is 09:52 PM.

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"