Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Unchecking all Forms checkboxes in entire sheet

I found this great code for unchecking all Form Toolbar created
checkboxes on a single sheet:


Sub Clearem()
Dim bx as object
For each bx in Worksheets("Sheet1").Checkboxes
bx.value = xlOff
Next
End Sub

How can I adapt this to uncheck all boxes in an entire workbook? I've
tried Activebook and workbook("") with no luck.

Thanks in adavnce.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Unchecking all Forms checkboxes in entire sheet

Use this code:

Dim objWorksheet As Worksheet

For Each objWorksheet In ActiveWorkbook.Worksheets
'Your For loop goes here
Next objWorksheet


michaelberrier wrote:
I found this great code for unchecking all Form Toolbar created
checkboxes on a single sheet:


Sub Clearem()
Dim bx as object
For each bx in Worksheets("Sheet1").Checkboxes
bx.value = xlOff
Next
End Sub

How can I adapt this to uncheck all boxes in an entire workbook? I've
tried Activebook and workbook("") with no luck.

Thanks in adavnce.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Unchecking all Forms checkboxes in entire sheet


That rocks!

Thanks,
mb

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Unchecking all Forms checkboxes in entire sheet

No need to loop Forms type checkboxes

Worksheets("Sheet1").CheckBoxes.Value = xlOff ' or xlOn checked

xlOff is -4146 but 0 also works, xlOn is +1

Regards,
Peter T

"michaelberrier" wrote in message
ups.com...
I found this great code for unchecking all Form Toolbar created
checkboxes on a single sheet:


Sub Clearem()
Dim bx as object
For each bx in Worksheets("Sheet1").Checkboxes
bx.value = xlOff
Next
End Sub

How can I adapt this to uncheck all boxes in an entire workbook? I've
tried Activebook and workbook("") with no luck.

Thanks in adavnce.



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
Checking and Unchecking CheckBoxes in code Ayo Excel Discussion (Misc queries) 0 April 3rd 09 08:41 PM
Forms - Checkboxes Jane Excel Worksheet Functions 3 October 3rd 06 02:21 PM
Checkboxes on forms Rmagic[_2_] Excel Programming 2 November 12th 05 10:26 AM
Checkboxes from the Forms Toolbar cht13er[_2_] Excel Programming 2 October 25th 05 11:50 PM
Can you hide forms checkboxes Matt Excel Programming 2 January 10th 04 06:32 PM


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