Avatar of agwalsh
agwalsh

asked on 

checkbox/option button in specific cell in Excel - how to add to cell

hi
I'm wondering how to do the following..
I want to set up a sheet so that the following happens...
The user ticks a checkbox/option button. This automatically gives the cell it is in a value e.g. -1 etc. I plan to have a calculations sheet set up with the formulas...but my first step is how do I add a checkbox that is linked to a specific cell so that I can reference that cell in a formula...
Thank you
Microsoft OfficeMicrosoft Excel

Avatar of undefined
Last Comment
byundt
SOLUTION
Avatar of ScriptAddict
ScriptAddict
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of ScriptAddict
ScriptAddict
Flag of United States of America image

After you insert it you format control, and click on the control tab.  And then link it to a cell.

Please note that there are "form" controls and Active X controls.  The Active X are designed to be used with VBA, so if you are not familiar with VBA or just don't want to use it make sure you insert the FORM controls :)

-SA
Avatar of agwalsh
agwalsh

ASKER

@Script Addict - thank you - got all that. Now when I check this value I get true - how could I set this to become a value if checked e.g. when it's checked, the value of that cell becomes -1 for example...
Avatar of ScriptAddict
ScriptAddict
Flag of United States of America image

Well, you have two options.  You could either use a formula that uses an if statement

Don't put the true/false cell in the cell you need the value in.  Then just use a formula like

if(A1=True, -1, 0)  - where A1 is the cell you do have the checkmark linked too.

Or you can use the VBA switch and use an event trigger to edit the cell value based on whatever vba you want to code.


Personally I'd just have my formula assign a value based on the True/false, and an if statement in my formula.
Avatar of agwalsh
agwalsh

ASKER

Ok, that's fine. I can do that...I just thought there might be a way in the properties to do it that I hadn't seen...thank you!
A
ASKER CERTIFIED SOLUTION
Avatar of byundt
byundt
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Microsoft Excel
Microsoft Excel

Microsoft Excel topics include formulas, formatting, VBA macros and user-defined functions, and everything else related to the spreadsheet user interface, including error messages.

144K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo