Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Please Help - Checkbox Data Validation question!!!

Good Afternoon,

I working on an Excel Sheet that Im setting up as a Test. I have set-up
Checkboxes using the Tools/Forms option that Im linking to corresponding
cells (the cells reflect a True or False value dependant on if they are
checked or not).

I found a formula which Ive pasted below that will Clear all the check
boxes and works great, but I also need a formula that will set up a Data
Validation/ Constraint for each group of questions. Since I cannot use the
typical Data Validation because no one is actually clicking the cells itself
€“ is there a way to monitor just the checkboxes themselves? For example, I
have a group of 5 checkboxes in Cells B15, B16, B17, F15 and F16 which all
have different answers to a related question. What I need is a way to make
sure the User does NOT check 2 Boxes.


Any ideas would be greatly appreciated and thank you in advance for your
thoughts €“ Jenny B.

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Formula I forgot to include in post


Sub Uncheckboxes()
Dim wks As Worksheet
Dim ckbx As OLEObject
Set wks = Worksheets("background")
With wks
.CheckBoxes.Value = False 'Form type clear
For Each ckbx In wks.OLEObjects
ckbx.Object.Value = False 'ActiveX type clear
Next ckbx
End With
End Sub

"Jenny B." wrote:

Good Afternoon,

I working on an Excel Sheet that Im setting up as a Test. I have set-up
Checkboxes using the Tools/Forms option that Im linking to corresponding
cells (the cells reflect a True or False value dependant on if they are
checked or not).

I found a formula which Ive pasted below that will Clear all the check
boxes and works great, but I also need a formula that will set up a Data
Validation/ Constraint for each group of questions. Since I cannot use the
typical Data Validation because no one is actually clicking the cells itself
€“ is there a way to monitor just the checkboxes themselves? For example, I
have a group of 5 checkboxes in Cells B15, B16, B17, F15 and F16 which all
have different answers to a related question. What I need is a way to make
sure the User does NOT check 2 Boxes.


Any ideas would be greatly appreciated and thank you in advance for your
thoughts €“ Jenny B.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Formula I forgot to include in post

It appears your CheckBoxes came from the Forms toolbar (as opposed to them
being ActiveX controls). Given that, the Uncheckboxes subroutine can be
replaced with this single line...

Worksheets("background").CheckBoxes.Value = False

or, if you code is executing from the same worksheet as the CheckBoxes are
on...

ActiveSheet.CheckBoxes.Value = False

This solution is modeled after a post Dave Peterson offered on Wed, 18 Jul
2007 11:07:30 (-0500) on the microsoft.public.excel.programming newsgroup
(Subject: Visual Basic code). In that posting, Dave was deleting Form
Toolbar generated Option buttons. He also warned that the deletions wouldn't
work if there were too many (without specifying how many that might be)
OptionButtons on the worksheet. I am not sure whether this limit would apply
to the above or not, but I test it out for 100 CheckBoxes and it worked
fine.

I would have provided a link to the posting, but Google isn't showing any
posts after July 17th right now. Didn't Google used to be only several hours
behind physical postings in the past? Is Google broken or, perhaps, just
over-extended? Anyone else seeing these kind of delays in Google?

Rick



"Jenny B." wrote in message
...

Sub Uncheckboxes()
Dim wks As Worksheet
Dim ckbx As OLEObject
Set wks = Worksheets("background")
With wks
.CheckBoxes.Value = False 'Form type clear
For Each ckbx In wks.OLEObjects
ckbx.Object.Value = False 'ActiveX type clear
Next ckbx
End With
End Sub

"Jenny B." wrote:

Good Afternoon,

I working on an Excel Sheet that Im setting up as a Test. I have set-up
Checkboxes using the Tools/Forms option that Im linking to corresponding
cells (the cells reflect a True or False value dependant on if they are
checked or not).

I found a formula which Ive pasted below that will Clear all the check
boxes and works great, but I also need a formula that will set up a Data
Validation/ Constraint for each group of questions. Since I cannot use
the
typical Data Validation because no one is actually clicking the cells
itself
€“ is there a way to monitor just the checkboxes themselves? For example,
I
have a group of 5 checkboxes in Cells B15, B16, B17, F15 and F16 which
all
have different answers to a related question. What I need is a way to
make
sure the User does NOT check 2 Boxes.


Any ideas would be greatly appreciated and thank you in advance for your
thoughts €“ Jenny B.


  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,202
Default Please Help - Checkbox Data Validation question!!!

What I need is a way to make
sure the User does NOT check 2 Boxes.


Why aren't you using Option Buttons then?

Rick
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 94
Default Please Help - Checkbox Data Validation question!!!

Hi Rick,

Im not using the Option Button because Im not that familiar with it (also
it does not have a simpleton link to each cell like the checkbox).
Additionally, Im trying to capture what each cell/checkbox reads out after
selected. This means if I have a group of 4 answers €“ Im looking to note the
answer selected to another page. So if someone chooses answer (checkbox 2),
Ive also set-up a formula on another page that captures that data for later
review. Thats why I was looking to put the constraints on the question
group. If someone checks more than one box, it pulls over multiple answers
and that screws up my data collection.

Is there any quick Macro you could help me with (still using the checkboxes)
that could assign each check box a value (for instance checkbox1 = 1 etc)?
That way, I could set up a validation Macro that would somehow state that 1
would bring up a msgbox letting them know they can only select one from the
group.

Thanks so much for your help and appreciate any further advice €“ Jenny B.


"Rick Rothstein (MVP - VB)" wrote:

What I need is a way to make
sure the User does NOT check 2 Boxes.


Why aren't you using Option Buttons then?

Rick

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
Data Validation Question ALEX Excel Worksheet Functions 5 February 2nd 07 02:46 PM
Data Validation Question Andrew Mackenzie Excel Discussion (Misc queries) 1 January 22nd 07 02:57 PM
Data Validation Question dgraham Excel Discussion (Misc queries) 6 April 28th 06 01:03 PM
DataValidation Question Weave New Users to Excel 2 December 12th 05 08:06 PM
Data validation question Ted Rogers New Users to Excel 3 September 5th 05 12:26 AM


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