Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Software Development
Tag Cloud
access audio black screen blue screen boot bsod connection crash dell desktop driver drivers dvd email error excel firefox hard drive hardware hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem processor recovery registry cleaner router safe mode slow sound spyware tdlwsp.dll trojan vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Software Development >
Excel checkboxes

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

 
Thread Tools
VanHelsing's Avatar
Junior Member with 5 posts.
 
Join Date: Nov 2009
Experience: Intermediate
03-Nov-2009, 09: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 offline
Computer Specs
Distinguished Member with 9,342 posts.
 
Join Date: Mar 2005
Location: UK
Experience: An old Basic Programmer
03-Nov-2009, 10: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, 01: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, 01: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, 08: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 Bookmark and Share

Tags
checkbox, excel

Smart Search

Find your solution!



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


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 03:37 PM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.