Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Checkbox programatically to form
In my form's initialise event I'm trying to programmatically add a checkbox,
which I wouldn't have thought was too hard, but I just can't get it to work. Admittedly I'm using trial and error but it's just not happening. Anyone able to put me out of my misery please? Thanks matt |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Checkbox programatically to form
Why not add the checkbox in design mode and make it not visible until you
need it. This would be alot simpler. If you want to pursue your current approach, John Walkenbach has some information: http://j-walk.com/ss/excel/tips/tip76.htm http://j-walk.com/ss/excel/tips/tip44.htm http://support.microsoft.com/default...b;en-us;185774 How to Programmatically Manipulate a UserForm has a section "Adding Controls to the UserForm" http://support.microsoft.com/default...b;en-us;829070 How to use Visual Basic for Applications (VBA) to change UserForms in Excel 2003, Excel 2002, and Excel 2000 -- Regards, Tom Ogilvy "Matt Jensen" wrote in message ... In my form's initialise event I'm trying to programmatically add a checkbox, which I wouldn't have thought was too hard, but I just can't get it to work. Admittedly I'm using trial and error but it's just not happening. Anyone able to put me out of my misery please? Thanks matt |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Checkbox programatically to form
Great - thanks Tom - heaps of useful info there
Cheers Matt "Tom Ogilvy" wrote in message ... Why not add the checkbox in design mode and make it not visible until you need it. This would be alot simpler. If you want to pursue your current approach, John Walkenbach has some information: http://j-walk.com/ss/excel/tips/tip76.htm http://j-walk.com/ss/excel/tips/tip44.htm http://support.microsoft.com/default...b;en-us;185774 How to Programmatically Manipulate a UserForm has a section "Adding Controls to the UserForm" http://support.microsoft.com/default...b;en-us;829070 How to use Visual Basic for Applications (VBA) to change UserForms in Excel 2003, Excel 2002, and Excel 2000 -- Regards, Tom Ogilvy "Matt Jensen" wrote in message ... In my form's initialise event I'm trying to programmatically add a checkbox, which I wouldn't have thought was too hard, but I just can't get it to work. Admittedly I'm using trial and error but it's just not happening. Anyone able to put me out of my misery please? Thanks matt |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Checkbox programatically to form
Matt,
Here is a simple example Set newButton = Me.Controls.Add("Forms.Checkbox.1") newButton.Caption = "Another Checkbox" With newButton .Left = 100 .Top = 50 .Visible = True End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Matt Jensen" wrote in message ... In my form's initialise event I'm trying to programmatically add a checkbox, which I wouldn't have thought was too hard, but I just can't get it to work. Admittedly I'm using trial and error but it's just not happening. Anyone able to put me out of my misery please? Thanks matt |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Add Checkbox programatically to form
Thanks Bob
Matt "Bob Phillips" wrote in message ... Matt, Here is a simple example Set newButton = Me.Controls.Add("Forms.Checkbox.1") newButton.Caption = "Another Checkbox" With newButton .Left = 100 .Top = 50 .Visible = True End With End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Matt Jensen" wrote in message ... In my form's initialise event I'm trying to programmatically add a checkbox, which I wouldn't have thought was too hard, but I just can't get it to work. Admittedly I'm using trial and error but it's just not happening. Anyone able to put me out of my misery please? Thanks matt |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Clear a Checkbox in a a user form | Excel Discussion (Misc queries) | |||
Form CheckBox font size / style | Excel Discussion (Misc queries) | |||
How do I make a checkbox bigger in an excel form? | Excel Discussion (Misc queries) | |||
add size option to excel form checkbox | Excel Discussion (Misc queries) | |||
creating checkbox through form | Excel Programming |