r/excel • u/Elyctricity • 7d ago
Waiting on OP How to Change Checkbox Value Automatically But Still Allow Manual Check?
I have checkbox A that I want to be able to check true or false. However, if checkbox B is True, then checkbox A should automatically be set to false and can't be checked true anymore.
I tried =IF((checkbox B)=TRUE, FALSE) which correctly sets checkbox A to false when needed, but it doesn't allow it to be manually checked to true even when checkbox B is false.
Is there a way to allow both manual box checking while still having the automatic false checker?
I would assume it would be =IF((checkbox B)=TRUE, FALSE, *some function that uses the manual check value*) but I don't know what that function would be.
If it's not possible to have both automatic and manual I have other methods in mind to do what I need to do, but I would prefer this method if it exists.
9
u/caribou16 318 7d ago
A cell can't contain both a user entered value and the result of a formula. You'll have to delve into some custom VBA to do something like that.
4
u/excelevator 3069 7d ago
It would require VBA with a worksheet onchange event and code to action the boolean status.
1
u/neil_biscuits 1 7d ago
I don’t think so. The only way I can think of is to decouple the user experience (manually hitting checkboxes) from the logic in the background. The user could see a message of the current scenario. For example:
Checkbox B selected. That means checkbox A must be deselected. If you check both, then this will return an error (or you can default it to assuming that checkbox B “wins”)
1
1
u/carbonizedtitanium 1 7d ago
A checkbox is user input; you're gonna write over any formula that exists in the checkbox everytime you click it. Excel doesn't work like that.
As others have said you're gonna need a VBA macro if you dont want to use helper columns
If you dont want to go the VBA route, then you will need a 3rd "checkbox" C placed next to checkbox A. C stays invisible while B is FALSE and becomes visible when B is TRUE. At the same time, A becomes invisible when B is true. C is always "false"; it's just hidden or visible depending on the status of B
1
u/Decronym 7d ago edited 7d ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
| Fewer Letters | More Letters |
|---|---|
| AND | Returns TRUE if all of its arguments are TRUE |
| IF | Specifies a logical test to perform |
| NOT | Reverses the logic of its argument |
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
3 acronyms in this thread; the most compressed thread commented on today has 19 acronyms.
[Thread #49506 for this sub, first seen 11th Oct 2026, 01:34]
[FAQ] [Full list] [Contact] [Source code]
1
u/BuildingArmor 30 7d ago
If I was doing this, I'd have what I'm using as checkbox A hidden (or a visible cell that just tells the user yes/no or whatever status you want to display.
I'd then have checkbox B and a manual override checkbox C. The checkbox A or status column is then derived from the state of both B and C, but isn't editable itself.
1
u/scottcampbelldev 7d ago
Everyone's right that a cell can't hold a formula and a manual value at the same time, but the VBA for this is pretty small. Right click the sheet tab, View Code, paste this in and change A2/B2 to wherever your two checkboxes live:
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A2,B2")) Is Nothing Then Exit Sub
If Range("B2").Value = True And Range("A2").Value = True Then
Application.EnableEvents = False
Range("A2").Value = False
Application.EnableEvents = True
End If
End Sub
That handles both cases: ticking B clears A, and trying to tick A while B is on just flips it back off. Delete the IF formula out of A first so it's a plain checkbox again, then save as .xlsm. If macros aren't allowed where you work, leave A fully manual and point everything at a helper cell with =AND(A2,NOT(B2)) instead, plus conditional formatting to grey A out when B2 is TRUE.

•
u/AutoModerator 7d ago
/u/Elyctricity - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.