Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Dynamic creation, or something different needed? | Excel Worksheet Functions | |||
Peltiertech dynamic control chart | Charts and Charting in Excel | |||
Dynamic Formula Creation?? | Excel Discussion (Misc queries) | |||
Dynamic Control Tip Text | Excel Discussion (Misc queries) | |||
Dynamic Creation of borders | Excel Programming |