Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default 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
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
Clear a Checkbox in a a user form Cerberus Excel Discussion (Misc queries) 6 June 26th 08 10:41 PM
Form CheckBox font size / style tikchye_oldLearner57 Excel Discussion (Misc queries) 2 March 15th 07 01:34 AM
How do I make a checkbox bigger in an excel form? tscyw8 Excel Discussion (Misc queries) 0 February 7th 06 10:22 PM
add size option to excel form checkbox TG Excel Discussion (Misc queries) 0 April 28th 05 09:20 PM
creating checkbox through form yami-s[_5_] Excel Programming 2 February 18th 04 04:18 PM


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