Drop Down Lists

WagnerE

New Member
Joined
Sep 2, 2015
Messages
2
Hi there,

This is my first time posting and really have little in-depth experience with excel. With that said, I am tasked with creating a spreadsheet for calculating some estimate numbers at my work. So here is my dilemma.

I have a cell in A1 that is a drop down list. Based upon what you pick, cells B1 through B16 populate with either text or are left blank. What I am having trouble with is that cells C1 through C16 need to have a drop down list in them, but only if there is text in the corresponding B cell. So if B10 has text, C10 will now have a drop down list of values available, but if B10 is blank, I need cell C10 to be blank as well.

I have scoured through the internet and many forums, but all I have been able to find are drop down list dependent upon drop down lists, and that doesn't seem to cover the reverting back to blank status.

Thanks for you help.
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I would use named ranges and use those to select your lists.

If you want the list dependent on the results of the above cell then use an if statement in the data validation box.

Select data validation
select list

in the text box type something like

=IF(b10="","",[your named range here])
 
Upvote 0
RCBricker,

I went with your suggestion, the problem is that they want to use the sheet multiple times in the same session, changing which B cells have text in them. Using that formula, the C cell stays on the last option that you have picked once there is no text in the B cell. Now, I could have a blank option in the C cell drop down list and have to change it before using the spreadsheet again, but I know that the higher ups will want some kind of automation where they change the option in the A cell, and it clears out the previous information in the C cells.
 
Upvote 0
Hey WagnerE,

I looked around and found the following code. It is an worksheet change event so it needs to be inserted into the worksheet that houses the dropdowns. in the VBE just select the worksheet by double clicking the name fo the sheet in the VBAProject window. Then paste the code into the sheet.

****NOTE you need to change the target.row = 2 to the row number that houses the conditional drop downs.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Target.Row = 2 Then  'change this number to the row that houses the drop downs
  If Target.Validation.Type = 3 Then
   Application.EnableEvents = False
   Target.Offset(1).ClearContents
  End If
End If

exitHandler:
  Application.EnableEvents = True
  Exit Sub

End Sub

rich
 
Upvote 0
Rich,
I double clicked on sheet1 under the Excel objects under VBAProject, pasted the code above in and changed the row to 19. However, the cell contents do not delete when the other cell is changed. I can only see 1 difference; there are 6 drop downs on the sheet and the width of the selection list that appears when clicking on the drop downs on all of them are now all as wide as the widest drop down, rather than them each being the same width as the cell it is in (hope that makes sense!).
Any ideas?
Thanks, Dave
 
Upvote 0

Forum statistics

Threads
1,215,794
Messages
6,126,944
Members
449,349
Latest member
Omer Lutfu Neziroglu

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