Checkboxes and forumulas

jmc92

New Member
Joined
Aug 16, 2018
Messages
2
So I just dived into excel today, and I think I've made decent progress.
You can see it here:
https://ufile.io/i8647

What I am trying to do is get the form check boxes (hopefully I can do this dynamically so I don't have to manually set up every check box)
To link to the small navy blue cell right about the bill description. (B1) (I don't care about seeing the true/false)
And when the checkbox is clicked true, the goal is to have the amount in B4, get subtracted off of the total amount in B38. Each check box would effect B38 as a total. And when unchecked, the amount would be added back into B38.

I tried putting a formula such as "=If B1,TRUE-SUM(B38,-B4)" into B1, but it didn't work.
=SUMIF(B1,"TRUE",B38:-B4) Also didn't work.

Also whenever I click the check box, the formula I just put into B1 goes away, which is pretty frustrating. :mad:

I tried doing it by macro.
Code:
Sub CheckBox_123()

If CheckBoxes("CheckBox123").Value > 1 Then
[B38] = [B38] - [B4]
Else
[B38] = [B37]

End Sub

But yet again...this didn't work either :P
It's nearing 3am..can't google this much further right now lol
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hi & welcome to MrExcel
How about
Code:
If ActiveSheet.CheckBoxes(Application.Caller).Value = 1 Then
   [b38] = [b38] - [b4]
Else
   [b38] = [b38] + [b4]
End If
But if you are talking a lot checkboxes there may be other ways of doing what you want.
 
Upvote 0
Hello, thank you for your reply and welcome :)

Yes, there may be potentially hundreds of checkboxes building up over time. I'm hoping to be able to use the drag/copy handle to extend them further as needed.
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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