In dependent data validations the second column should show blank when first one is selected differently

realdemigod

Board Regular
Joined
Aug 19, 2014
Messages
51
Office Version
  1. 365
Platform
  1. MacOS
Hi,
I have two columns one with a product category (A) and the next one is sub-category (B). I created a dependent validation between these two columns.

A - Laboratory, Chemicals
Laboratory - Microscope, Other equipment
Chemicals - chem1, chem2, chem3

I selected Laboratory under A and then selected Microscope in the column B. But when I change to Chemicals the Microscope still shows under column B. Instead I want to make it blank in column B when I change the validation in column A and be able to select chem1 or chem2 or chem3. Is it possible?

Thanks
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Try this:
Put the code in the code module of the sheet where the data validation is located.
Change 'Range("A2:A10")' to suit.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    If Not Intersect(Target, Range("A2:A10")) Is Nothing Then
        If Target.Cells.Count = 1 Then
        Application.EnableEvents = False
             Target.Offset(, 1) = ""
        Application.EnableEvents = True
        End If
    End If
End Sub
 
Upvote 0
Thanks it is working, appreciate your help!:cool:

edit: I'm unable to change the title so that I can put SOLVED.
 
Last edited:
Upvote 0
You're welcome, glad to help, & thanks for the feedback.
We don't have rule to mark a thread as Solved here.:)
 
Upvote 0
You're welcome, glad to help, & thanks for the feedback.
We don't have rule to mark a thread as Solved here.:)

Oh good, you are welcome and thanks for letting me know. :)
 
Last edited:
Upvote 0
I don't know how to do this without a macro.
Is it possible?
I'm not sure.
 
Upvote 0

Forum statistics

Threads
1,215,647
Messages
6,126,005
Members
449,279
Latest member
Faraz5023

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