select drop down dynamically from excel

BMD44

Board Regular
Joined
Sep 25, 2019
Messages
72
Hello All,

I am trying to select values dynamically in drop down in 'Sheet' based on the source selection in 'Acct_Map' sheet. But, it doesn't show all values in the drop-down.

Attached the sheet. Can anyone please advise. Thanks for the help.


Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range, x
If Target.Row < 4 Then Exit Sub
If Intersect(Target, Columns("c")) Is Nothing Then Exit Sub
Application.EnableEvents = False
For Each r In Intersect(Target, Columns("c"))
With r(, 2)
.Validation.Delete: .ClearContents
If r.Value <> "" Then
x = Join(Filter(Sheets("Acct_Map").Evaluate("transpose(if(c1:c10000='" & _
Me.Name & "'!" & r.Address & ",d1:d10000))"), False, 0), ",")
If Len(x) Then .Validation.Add 3, Formula1:=x
'If Len(x) Then .Validation.Add Type:=xlValidateList, Formula1:=x

End If
End With
Next
Application.EnableEvents = True
End Sub
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.

Forum statistics

Threads
1,215,040
Messages
6,122,806
Members
449,095
Latest member
m_smith_solihull

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