Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Macro to clear checkboxes

Sorry for the duplicate posting. Previous posting was answered but solution
does not work and have had no further replies.
Is it possible to have a macro that can change all checkboxes that have been
set to checked back to €˜unchecked?
I need a macro that will clear all of the checks in €˜checkboxes (forms
object) on a sheet. The checkboxes are just basic checkboxes beside peoples
names and are manually selected (checked) when that person has paid. I would
like to be able to reset all of the checkboxes back to unchecked with a macro
button. I cant get the auto record macro function to select a forms object.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Macro to clear checkboxes

Guy,

How you trigger the macro to do this is up to you but this uses a commnd
button on your form

Private Sub CommandButton1_Click()
Dim cCont As Control
For Each cCont In Me.Controls
If TypeName(cCont) = "CheckBox" Then
cCont.Value = False
End If
Next cCont
End Sub

Mike

"Guy" wrote:

Sorry for the duplicate posting. Previous posting was answered but solution
does not work and have had no further replies.
Is it possible to have a macro that can change all checkboxes that have been
set to checked back to €˜unchecked?
I need a macro that will clear all of the checks in €˜checkboxes (forms
object) on a sheet. The checkboxes are just basic checkboxes beside peoples
names and are manually selected (checked) when that person has paid. I would
like to be able to reset all of the checkboxes back to unchecked with a macro
button. I cant get the auto record macro function to select a forms object.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Macro to clear checkboxes

Hi Mike,
I am just a novice at this and I can't seem to get this to work. I think I
have figured out how to post the code to the command button I put on the
sheet but just can't get it to work. I just copied and pasted your code to
the command button screen. This is the first time I have tried to use a
command button and I am probably just making a simple mistake. Can you help?

Guy

"Mike H" wrote:

Guy,

How you trigger the macro to do this is up to you but this uses a commnd
button on your form

Private Sub CommandButton1_Click()
Dim cCont As Control
For Each cCont In Me.Controls
If TypeName(cCont) = "CheckBox" Then
cCont.Value = False
End If
Next cCont
End Sub

Mike

"Guy" wrote:

Sorry for the duplicate posting. Previous posting was answered but solution
does not work and have had no further replies.
Is it possible to have a macro that can change all checkboxes that have been
set to checked back to €˜unchecked?
I need a macro that will clear all of the checks in €˜checkboxes (forms
object) on a sheet. The checkboxes are just basic checkboxes beside peoples
names and are manually selected (checked) when that person has paid. I would
like to be able to reset all of the checkboxes back to unchecked with a macro
button. I cant get the auto record macro function to select a forms object.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default Macro to clear checkboxes

Guy,

I had assumed you checkboxes were on a userform, if they are on a sheet then
put a button on your sheet (You may already have done this) and assign this
code to it

Dim ws As Worksheet
Dim obj As OLEObject
Set ws = ActiveSheet
For Each obj In ws.OLEObjects
If TypeName(obj.Object) = "CheckBox" Then
obj.Object.Value = False
End If
Next obj

Mike

"Guy" wrote:

Hi Mike,
I am just a novice at this and I can't seem to get this to work. I think I
have figured out how to post the code to the command button I put on the
sheet but just can't get it to work. I just copied and pasted your code to
the command button screen. This is the first time I have tried to use a
command button and I am probably just making a simple mistake. Can you help?

Guy

"Mike H" wrote:

Guy,

How you trigger the macro to do this is up to you but this uses a commnd
button on your form

Private Sub CommandButton1_Click()
Dim cCont As Control
For Each cCont In Me.Controls
If TypeName(cCont) = "CheckBox" Then
cCont.Value = False
End If
Next cCont
End Sub

Mike

"Guy" wrote:

Sorry for the duplicate posting. Previous posting was answered but solution
does not work and have had no further replies.
Is it possible to have a macro that can change all checkboxes that have been
set to checked back to €˜unchecked?
I need a macro that will clear all of the checks in €˜checkboxes (forms
object) on a sheet. The checkboxes are just basic checkboxes beside peoples
names and are manually selected (checked) when that person has paid. I would
like to be able to reset all of the checkboxes back to unchecked with a macro
button. I cant get the auto record macro function to select a forms object.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Macro to clear checkboxes

If those are checkboxes from the Forms toolbar:

Activesheet.checkboxes.value = xloff



Guy wrote:

Sorry for the duplicate posting. Previous posting was answered but solution
does not work and have had no further replies.
Is it possible to have a macro that can change all checkboxes that have been
set to checked back to €˜unchecked?
I need a macro that will clear all of the checks in €˜checkboxes (forms
object) on a sheet. The checkboxes are just basic checkboxes beside peoples
names and are manually selected (checked) when that person has paid. I would
like to be able to reset all of the checkboxes back to unchecked with a macro
button. I cant get the auto record macro function to select a forms object.


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 47
Default Macro to clear checkboxes

Thanks to everyone,
Ya'll are great!
Special thanks to Dave, that is the simplest code I have ever used and works
great.

Thanks,
Guy

"Dave Peterson" wrote:

If those are checkboxes from the Forms toolbar:

Activesheet.checkboxes.value = xloff



Guy wrote:

Sorry for the duplicate posting. Previous posting was answered but solution
does not work and have had no further replies.
Is it possible to have a macro that can change all checkboxes that have been
set to checked back to €˜unchecked€„¢?
I need a macro that will clear all of the checks in €˜checkboxes€„¢ (forms
object) on a sheet. The checkboxes are just basic checkboxes beside peoples
names and are manually selected (checked) when that person has paid. I would
like to be able to reset all of the checkboxes back to unchecked with a macro
button. I can€„¢t get the auto record macro function to select a forms object.


--

Dave Peterson

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
Macro to clear checkboxes and protected cells Guy[_2_] Excel Worksheet Functions 2 December 29th 08 08:54 PM
clear cells macro Dorothy Excel Discussion (Misc queries) 5 April 7th 08 12:46 AM
Clear Checkboxes fak119 Excel Discussion (Misc queries) 1 March 22nd 07 04:43 PM
How do I delete checkboxes from rows I deleted in a macro? Jazzi-D Excel Discussion (Misc queries) 1 January 18th 06 12:49 AM
Macro to make all checkboxes false and clear all comboxes ynissel Excel Discussion (Misc queries) 5 July 30th 05 12:22 AM


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