macro to set data validation drop down to blank after selecting item

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
Office Version
  1. 2021
Platform
  1. Windows
I would like a macro linked to the data validation list in Cell A1 on sheet1 that once item from the drop down has been selected the drop down returns blank

Your assistance in this regard is most appreciated
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Perhaps this.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Dim ValidationRange As Range
    
    Set ValidationRange = Me.Range("C2:C77") '<- Cells with dropdown validation. You must edit in your own range of cells here
    
    If Not Application.Intersect(ValidationRange, Target) Is Nothing And Target.Cells.Count = 1 Then
        On Error Resume Next
           Target.Validation.Delete
        On Error GoTo 0
    End If
End Sub
 
Upvote 0
I tested your code on Sample Data. After Selecting the item for the drop down, I need it to show Blank in A1 until I select from the drop Down Again


See link below to access my sample data


Kindly test & amend

 
Upvote 0
Does this achieve your aim Howard?

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False
    If Not Intersect(Range("A1"), Target) Is Nothing Then
        If Target = "" Then Exit Sub
        Target = ""
        Application.EnableEvents = True
        Exit Sub
    End If
End Sub
 
Upvote 0
Solution
Thanks for the help, Kevin. Code works perfectly
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,397
Members
448,957
Latest member
Hat4Life

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