Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Dynamic Userform problem...

Toppers

Excellent. The code you have offered I think I can work with to get what I
need.

Many thanks

"Toppers" wrote:

Alex,
One option is to put (pre-defined) labels and textboxes on your
Page 3 and then use the VISIBLE property to make them visible (or not) as
required, rather than dynamically create them.


Private Sub UserForm_Initialize()
For i = 1 To 3
Me.Controls("Textbox" & i).Visible = False ' <==textboxes are named
Textbox1, textbox2 etc
Next i
End Sub

Private Sub CommandButton1_Click()
For i = 1 To 3
Me.Controls("Textbox" & i).Visible = True
Next i
End Sub

HTH

"Alex" wrote:

Excel helper

I am really struggling with the folowing and cannot seem to get anything to
work, nor find anything if direct relevance on the internet.

I have created a 'Wizard' using a UserForm. My UserForm has 4 pages to the
wizard.

In page 2 is a multi Listbox which shows a part number and description of
that part. There are about 200 in total. Here I ask the user to select the
parts that they want to include in a report which they do so by using the
checkbooxes assigned.

Now for the tough bit. When they click <Next to go to Page 3 I want page 3
to display the parts they they have selected. Specifically I want to create a
label that shows the part number and add a text box where the user enters a
brief description of the destinatioon of the parts.

This set up would be 'dynamic' in the sense that if a user selected 2 parts
than they would see two part numbers and two textboxes on the next page etc.

I cannot work out to dynamically create labels / textboxes etc. I have tried:

Dim myLabel as MSForms.Label
Set myLabel = UserForm1.Cotrols.Add ("Forms.Label.1","mylabel",TRUE)

But this gives an error.

Any suggestions from here?

Infact I cannot work out how to use VBA to create labels etc on a UserForm
without doing it manually...

Thanks


Alex

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
dynamic userform masterphilch Excel Programming 1 November 7th 05 01:00 PM
Dynamic userform. Problem with format, events and returning values Claus[_3_] Excel Programming 2 September 1st 05 01:05 PM
Dynamic userform at runtime Ouka[_11_] Excel Programming 1 August 16th 05 02:44 PM
Getting values from a dynamic userform SupC Excel Programming 2 June 2nd 05 11:36 PM
How to create a dynamic Userform via VBA SuperJas Excel Programming 1 December 12th 03 02:51 AM


All times are GMT +1. The time now is 10:37 AM.

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"