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

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Forum statistics

Threads
1,215,343
Messages
6,124,405
Members
449,157
Latest member
mytux

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