Using checkboxes to populate a value if they are checked

usnapoleon

Board Regular
Joined
May 22, 2014
Messages
110
Office Version
  1. 365
Platform
  1. Windows
For starters, I have never used checkboxes before, so I have spent the last few hours watching videos and reading instructions and I have not been getting anywhere. Sorry to take your time.

I had an idea on a spreadsheet I'm creating, and it occurred to me that checkboxes might be the best solution for my goal. ---- if you can think of a different idea, please let me know, I'm open to going in other directions.

That aside, let me share my idea, my code, and what I'm aiming to do, and with your expertise we can see where to go from here.

1699510281298.png


My business has to write off certain expenses and our account coding breaks it out by department and the expense. My idea is for my team to input the expense code (that is the blue areas in column B) and we'd check the box for the specific department it's related to (columns c-f). Depending on the checked box, column G will be formulaed to input the department code that we see in the black row. That formula is what I need help with.

Way over to the side in column T (not shown) I have a sumif formula that will look at column G and B and give totals for the 'Amount' in column H. I am just letting you know what we're doing with the overall results.

I can write an ugly code like =if(c5=true,"0010",if(d5=true,"0430",if..... blah blah blah... I am just going off the top of my head but it would be ugly regardless. And long. And ugly. And long... haha.

I currently have the top row of checkboxes (row 5) linked to each cell... so the first one is lined to C5, literally the cell that the checkbox is located at. Unfortunately it automatically types 'TRUE' or 'FALSE'. Nothing I can do about that, other than recolor the cells to white, change the text to white and nobody would ever know. Not sure how wise this would be.

Also, I had the idea that a fail-safe might need to be in place where if one box is checked on a row, the other boxes should uncheck. I read that somewhere.

You know... I might even edit the formula in column G (whatever we can come up with)so that it gives the department AND adds the Account Code in Column B. I think that would be easy, and it makes for an easier sumif formula in column T that I mentioned previously.

As you can see, there just seems to be a lot of work needed to get this going and I'm not sure if the end result would be worth it. Looking forward to some help.

I know there are other ways I can make the spreadsheet work. For example, I can always write a key somewhere that shows the department numbers that users like myself can reference, and instead of 4 columns of checkboxes I can make a single column that is similar to column B and manually type the department number each time. I just thought it would be easier on the user and also super-cool to use checkboxes - just check a box and be done. Knowing that other solutions such as this exist is also why I'm open to going into other directions - there could be another very cool thing we can do that would make it super easy on the user.

I've talked enough, sorry... let me share my spreadsheet... i did a preview of this and noticed it didnt show the checkboxes, like I display in my snip above. Weird!!

Breck WO Template 11.23.xlsx
ABCDEFG
3▼TSW: BRECKADMIN ▼Dept :0011043000120410
4Ranahan - TSW direct billsAcct CodeFront DeskEngineeringHousekeepingA&G / AdminDept
5FALSEFALSE
6
7
Monthly Activity
 
Looks like you've got it 100% right :)(y)

Correct

Correct

I don't think you've missed anything - well done!

This is flippin amazing!!!
I'm very excited to bring this into production. Thank you a million times for your help on this. Checkboxes are very interesting. I've always stayed away from the VBA, so I would have been lost without your help. Thank you again!!!!
 
Upvote 0

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.

Forum statistics

Threads
1,224,811
Messages
6,181,081
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top