There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
Software Development
Tag Cloud
access acer asus bios bsod computer crash drive driver drivers error ethernet excel freeze games gaming hard drive hardware hdmi internet java laptop malware memory monitor motherboard music network obp printer problem ram random registry router slow software sound trojan usb video virus vista wifi windows windows 7 windows 7 32 bit windows 7 64 bit windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Excel checkboxes

Reply  
Thread Tools
VanHelsing's Avatar
Junior Member with 5 posts.
 
Join Date: Nov 2009
Experience: Intermediate
03-Nov-2009, 10:40 AM #1
Excel checkboxes
Hi,

I'd lie a little help please regarding Excel 2007 checkboxes. I have 3 of them but I only need one to be checked at a time. Can it be done with VBA automatically?

Thank you in advance.
OBP's Avatar
OBP OBP is online now
Computer Specs
Distinguished Member with 14,664 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
03-Nov-2009, 11:39 AM #2
VanHelsing, welcome to the Forum.
You usually get a quicker and better response to Excel/Access/Word questions if you post on the Business Applications Forum.
But to get back to your question, each Checkbox will need VBA like this one for Checkbox1, I am sure that you can work out the other two.

Private Sub CheckBox1_Click()
If CheckBox1 = -1 Then
CheckBox2 = 0
CheckBox3 = 0
End If
End Sub
__________________
OBP
I do not give up easily
wedonttakecrap's Avatar
Junior Member with 7 posts.
 
Join Date: Nov 2009
Experience: Advanced
03-Nov-2009, 02:28 PM #3
Hello VanHelsing,

I was wondering why, in this instance, you were using checkboxes instead of a Option (radio) button group? Option buttons only allow one choice to be selected, and saves tedious programming.

A friendly bit of advice to any who may read this: For simple applications of checkboxes and radio buttons, be sure to use the Form Controls from "Developer > Controls > Insert" on the ribbon. It not only saves programming time, but they are not blocked by macro security settings.

happy hacking.
VanHelsing's Avatar
Junior Member with 5 posts.
 
Join Date: Nov 2009
Experience: Intermediate
04-Nov-2009, 02:24 AM #4
Thank you both very much, I got my question answered
But I have another one: Using radio buttons is excellent but I have 3 different sections, each containing 3 radio buttons and I need those 3 sections to be selected independently.
wedonttakecrap's Avatar
Junior Member with 7 posts.
 
Join Date: Nov 2009
Experience: Advanced
04-Nov-2009, 09:39 PM #5
First, place a group control. Then place your radio buttons inside the borders of the group control. It's ridiculously easy in 2007, but not terribly intuitive.

The radio buttons will only interact with the other ones in the control borders

Cheers.
Reply

Tags
checkbox, excel

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.
Thread Tools



Facebook Facebook Twitter Twitter TechGuy.tv TechGuy.tv Mobile TSG Mobile
You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 07:34 AM.
Copyright © 1996 - 2011 TechGuy, Inc. All rights reserved.

Powered by Cermak Technologies, Inc.