Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to reset checkboxes from control tool box?

Hi,
I have 25 checkboxes in one worksheet. I think it would be
covenient to another checkbox to clear all checkboxes. Can someone
show me how to do that?

Thanks

Ivan

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default How to reset checkboxes from control tool box?

Try this:

Private Sub CheckBox26_Click()
' This works as clear all for other checkboxes 1 t0 25
Dim k as integer
If CheckBox26.Value = False Then ' Checkbox26 is the control checkbox
to clear the other 25
For k = 1 To 25 ' check boxes 1 to 25
Me.Controls("Checkbox" & k).Value =' False set all boxes false
Next k
End If
End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default How to reset checkboxes from control tool box?

steve:

you have a typo, your apostrophe is before False.

--


Gary


"stevebriz" wrote in message
oups.com...
Try this:

Private Sub CheckBox26_Click()
' This works as clear all for other checkboxes 1 t0 25
Dim k as integer
If CheckBox26.Value = False Then ' Checkbox26 is the control checkbox
to clear the other 25
For k = 1 To 25 ' check boxes 1 to 25
Me.Controls("Checkbox" & k).Value =' False set all boxes false
Next k
End If
End Sub



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to reset checkboxes from control tool box?


stevebriz wrote:
Try this:

Private Sub CheckBox26_Click()
' This works as clear all for other checkboxes 1 t0 25
Dim k as integer
If CheckBox26.Value = False Then ' Checkbox26 is the control checkbox
to clear the other 25
For k = 1 To 25 ' check boxes 1 to 25
Me.Controls("Checkbox" & k).Value =' False set all boxes false
Next k
End If
End Sub


Hi Stevebriz,
Thanks a lot for the tip!
I got a syntax error message and this line " Me.Controls("Checkbox" &
k).Value =' False set all boxes false" was highlighted. Do you know
why? Thanks

Ivan

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default How to reset checkboxes from control tool box?

ry I had a typo

replace the line with

Me.Controls("Checkbox" & k).Value = False 'set all boxes false



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to reset checkboxes from control tool box?


stevebriz wrote:
ry I had a typo

replace the line with

Me.Controls("Checkbox" & k).Value = False 'set all boxes false


Thanks again!

Now I got another message: "Compile error: Method or Data member not
found."

Thanks.

Ivan

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default How to reset checkboxes from control tool box?

what is the line is the error on?

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to reset checkboxes from control tool box?


stevebriz wrote:
what is the line is the error on?


It is the line below with ".Controls" being hightlighted.

Me.Controls("Checkbox" & k).Value = False 'set all boxes false

Thanks

Ivan

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default How to reset checkboxes from control tool box?

If you have the code in a command_click -is the command button you are
clicking on the same form as the checkboxes. or
if the code is checkbox26_click then checkbox26 in the same form as
the other 25 checkboxes?

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 195
Default How to reset checkboxes from control tool box?

If you have the code in a command_click -is the command button you are
clicking on the same form as the checkboxes. or
if the code is checkbox26_click then checkbox26 in the same form as
the other 25 checkboxes?



  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default How to reset checkboxes from control tool box?


stevebriz wrote:
If you have the code in a command_click -is the command button you are
clicking on the same form as the checkboxes. or
if the code is checkbox26_click then checkbox26 in the same form as
the other 25 checkboxes?


The code is in checkbox26_click. It is the same form as others from
control toolbox.


Ivan

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
How do I add a control check box to control other checkboxes? JGarland Excel Worksheet Functions 1 September 18th 08 12:26 PM
CheckBoxes: How to reset Rob Excel Discussion (Misc queries) 9 September 8th 06 04:25 AM
Reset Checkboxes from Control Tool Box Robert Excel Programming 7 August 22nd 06 05:36 AM
creating checkboxes from forms tool bar KB Excel Worksheet Functions 2 April 25th 06 03:53 AM
Tool Tip Text for Form control/ Active-X control Freddie[_2_] Excel Programming 0 October 19th 04 04:14 AM


All times are GMT +1. The time now is 04:19 PM.

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"