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

Hi,
I am doind a Userform with 20 checkbox on it. So to do their properties I would like to use a for next. I have try to do it with a string like str = checkbox & "k" but it doesn't work. And I don't know how to do it with an object. Do you know a way to do it ?
Thanks for help
Benjamin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Userform and checkbox....

Hi Benjamin,

I am doind a Userform with 20 checkbox on it. So to do their properties I would like to use a for next. I have try to do it with a string like str = checkbox & "k" but it doesn't work. And I don't know how to do it with an object. Do you know a way to do it ?


You need to create their names as a string, then use the Controls() property to get the object:

Me.Controls("CheckBox " & k)

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Userform and checkbox....

Euh....
I am sorry but I am not sure of how do I create their name as a string
Do I have to use checkbox.name to rename them
Thanks for help Stephe
Benjamin
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Userform and checkbox....

for i = 1 to 10
controls("CheckBox" & i).Value = False
Next

as an example.

another approach

for each ctrl in Userform1.Controls
if typeof ctrl is MSForms.CheckBox then
ctrl.Value = false
end if
Next

--
Regards,
Tom Ogilvy

"Ben.c" wrote in message
...
Euh.....
I am sorry but I am not sure of how do I create their name as a string ?
Do I have to use checkbox.name to rename them ?
Thanks for help Stephen
Benjamin



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
Checkbox dcb1 Setting up and Configuration of Excel 3 September 29th 08 02:55 AM
Checkbox AlliSun Excel Discussion (Misc queries) 2 September 17th 08 09:48 PM
Font Issues when using UserForm box after clicking a Checkbox RobGolf72 Excel Discussion (Misc queries) 1 October 9th 07 07:51 PM
How to have Checkbox A uncheck with checked Checkbox B Texas Aggie Excel Discussion (Misc queries) 3 July 20th 07 10:58 PM
Conditional Checkbox Creation on a UserForm Todd Huttenstine[_2_] Excel Programming 1 November 21st 03 03:38 PM


All times are GMT +1. The time now is 08:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"