Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default new instances of nested controls

Hoping some fo your experts out there can help.

I'm working on an application that has a multipage control, with
several controls within it.

Depending on the value of a variable I would like to copy and paste
that multipaga control (with the nested controls in it) on the userform
x number of times.

I know I could easily create many 20 or so copies of the multipage
control at deisgn time and just hide the ones I don't need, but this
seems like a rather crude method of implementing what I want to do

Is there an easy way replicating a multipage control (with the nested
controls) several times within a userform?

I would appreciate any help you can give.

Regards

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default new instances of nested controls

' in say form initialize event
Dim newPage As Page
Dim nPages As Long
Dim i As Long

With Me.MultiPage1
nPages = .Count
.Pages(0).Controls.Copy ' copy first page

For i = 1 To 4 ' 20
Set newPage = .Pages.Add("Page" & (nPages + i), _
"New-Page " & (nPages + 1), nPages)
newPage.Paste
nPages = nPages + 1
Next
End With

You will probably want to sub-class events for all controls on each page,
including the original page.

Regards,
Peter T

"nytrex" wrote in message
oups.com...
Hoping some fo your experts out there can help.

I'm working on an application that has a multipage control, with
several controls within it.

Depending on the value of a variable I would like to copy and paste
that multipaga control (with the nested controls in it) on the userform
x number of times.

I know I could easily create many 20 or so copies of the multipage
control at deisgn time and just hide the ones I don't need, but this
seems like a rather crude method of implementing what I want to do

Is there an easy way replicating a multipage control (with the nested
controls) several times within a userform?

I would appreciate any help you can give.

Regards



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
Create list of unique instances from list of multiple Instances Dishon Excel Worksheet Functions 0 March 3rd 08 10:46 AM
nested if based on nested if in seperate sheet. how? scouserabbit Excel Worksheet Functions 5 March 2nd 07 04:03 PM
ActiveX Controls vs Form Controls Alex Excel Discussion (Misc queries) 1 January 11th 06 08:46 AM
Event procedures for controls added with Controls.Add John Austin[_4_] Excel Programming 1 March 9th 05 03:31 PM
Is there an easy way to replace list A instances with list B instances (sorted lists). kkip Excel Programming 3 December 31st 03 01:50 PM


All times are GMT +1. The time now is 05:07 PM.

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

About Us

"It's about Microsoft Excel"