Clear a cell when select ANY option from drop down?

FatalLordes

Board Regular
Joined
Dec 22, 2017
Messages
76
Office Version
  1. 365
Platform
  1. Windows
Morning all (well, it is morning here).

So I'm using O365 and I'm wondering if there is any way to have excel clear a cell (lets say D16) when you make ANY selection from a drop down box located in another cell? And continuing on from that, as well as clearing a cell so that it contains nothing, it is also possible to set another cell (lets say C42), which contains a tick box, to clear the tick in the box if it is there when you make ANY selection from the same drop down box. Great if either one can be done. Fantastic if both can be done. :)
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Please try the following on a copy of your workbook. Put the code in the worksheet module of the sheet in question. Make the changes as suggested in the code.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Cells.CountLarge = 1 And Target.Address = "$A$1" Then '<< change A1 to your dropdown cell address
        [D16].ClearContents
        Me.CheckBoxes("Check Box 1").Value = False  '<< change checkbox name to your actual checkbox name
    End If
End Sub
 
Upvote 0
Please try the following on a copy of your workbook. Put the code in the worksheet module of the sheet in question. Make the changes as suggested in the code.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Cells.CountLarge = 1 And Target.Address = "$A$1" Then '<< change A1 to your dropdown cell address
        [D16].ClearContents
        Me.CheckBoxes("Check Box 1").Value = False  '<< change checkbox name to your actual checkbox name
    End If
End Sub
Thanks Kevin. I got the D16 cell part to work but, um, how do I name a checkbox? I've always just picked it from the menu and I didn't think there were any options to name it??
 
Upvote 0
If you right-click on the check box, its name will appear in the name box (top left of screen above cell A1).
 
Upvote 0
Oh yeah, well, I did that (it is called ReminderSent) but when I run I get the following error. What have I missed?
1730174846086.png
 
Upvote 0
It works for me using this code:

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Target.Cells.CountLarge = 1 And Target.Address = "$A$1" Then '<< change A1 to your dropdown cell address
        [D16].ClearContents
        Me.CheckBoxes("ReminderSent").Value = False  '<< change checkbox name to your actual checkbox name
    End If
End Sub

Link to demo file here
 
Upvote 0

Forum statistics

Threads
1,224,812
Messages
6,181,104
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