VBA code, worksheet_SelectionChange to create a searchable drop-down box

JackDanIce

Well-known Member
Joined
Feb 3, 2010
Messages
9,922
Office Version
  1. 365
Platform
  1. Windows
Hi,

Not having much joy with this. There are some non-VBA suggestions but I can't get them to work how I need.

In an input sheet, I have a defined table (used for input area).

In this table, on a a specific column, I want to create a searchable drop-down box only when the user selects a cell in that column, where the user can start typing into a search box and the selectable list shrinks to show only values containing the characters typed. This needs to occur for each row in the given column in the table.

In a separate data sheet, I have a defined table with the entire list of values the drop-down should have.

Finally, after a value has been selected by user, I want to add 2 formula to the adjacent columns on the right.

I want to avoid using UserForms, any suggestions?

TIA,
Jack
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Making some progress, combing VBA and guide from this video:

The dynamic formula I have is:
Code:
=SORT(UNIQUE(FILTER(tbl_MetaData[Drop-Down Values],ISNUMBER(SEARCH(Sales!$C$14,tbl_MetaData[Drop-Down Values])),"not found")))

However, when I run macro to change part in red, the formula updates to:
Code:
=@SORT(UNIQUE(FILTER(tbl_MetaData[Drop-Down Values],ISNUMBER(SEARCH(Sales!$C$14,tbl_MetaData[Drop-Down Values])),"not found")))
Even though I haven't included @ in my code or typed it into the cell.

How can I prevent Excel auto-inserting the @? When it doesn't exist I have a dynamic array of results. After macro runs and the @ is added, it only shows a single result (losing the full list of matches)
 
Upvote 0
Code:
r.Formula2 = _
            Replace("=SORT(UNIQUE(FILTER(tbl_MetaData[Drop-Down Values],ISNUMBER(SEARCH(#ADD,tbl_MetaData[Drop-Down Values])),""not found"")))", "#ADD", sheetname & "!" & rng.Address)
Needed to use .Formula2
 
Upvote 0

Forum statistics

Threads
1,214,383
Messages
6,119,196
Members
448,874
Latest member
Lancelots

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