Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Dynamic Control Creation in VBA

There are 4 text boxes horizontally placed. As soon as the user leaves the
last one, another set of 4 text boxes are created below the original 4 ...
and this continues.

That's how I was envisaging my user form, as I thought it would enhance the
usablity of the form. And in any case I don't know beforehand how many such
sets of text boxes the user will need. Now I'm disappointed to know dynamic
control creation isn't possible in hosted VBA. Is there any alternative way?

Thanks. ~Asif






  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Dynamic Control Creation in VBA

This certainly seems possible to do whats the difficulty? I've created txt box's before on the fly and its worked fine
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Dynamic Control Creation in VBA

I don't know why you would say it isn't supported since that isn't correct.

In fact you can dynamically create controls on a userform.

From John Walkenbach's site

http://j-walk.com/ss/excel/tips/tip76.htm
Creating a UserForm Programmatically


A simple example:

Private Sub CommandButton1_Click()
Dim tbox As MSForms.TextBox
Set tbox = Controls.Add("Forms.TextBox.1", _
Name:="Textbox5", Visible:=True)
tbox.Top = TextBox1.Top + TextBox1.Height + 10
tbox.Left = TextBox1.Left
tbox.Width = TextBox1.Width
tbox.Height = TextBox1.Height
End Sub

--
Regards,
Tom Ogilvy



"Asif" wrote in message
...
There are 4 text boxes horizontally placed. As soon as the user leaves the
last one, another set of 4 text boxes are created below the original 4 ...
and this continues.

That's how I was envisaging my user form, as I thought it would enhance

the
usablity of the form. And in any case I don't know beforehand how many

such
sets of text boxes the user will need. Now I'm disappointed to know

dynamic
control creation isn't possible in hosted VBA. Is there any alternative

way?

Thanks. ~Asif








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 creation, or something different needed? Nehvun Excel Worksheet Functions 0 July 31st 07 06:12 AM
Peltiertech dynamic control chart Daniel Charts and Charting in Excel 2 June 21st 07 10:34 PM
Dynamic Formula Creation?? [email protected] Excel Discussion (Misc queries) 2 October 27th 06 09:14 AM
Dynamic Control Tip Text BillyJ Excel Discussion (Misc queries) 1 October 5th 06 06:37 PM
Dynamic Creation of borders Tyrusst Excel Programming 1 October 15th 03 12:47 PM


All times are GMT +1. The time now is 03:15 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"