Here is a very good way to handle this (found on ozgrid):
Let's say your list is on Sheet2
and you wish to use the Validation List with AutoComplete on Sheet1
.
On Sheet1
A1
Enter =Sheet2!A1
and copy down including as many spare rows as needed (say 300 rows total). Hide these rows and use this formula in the Refers to: for a dynamic named range called MyList:
=OFFSET(Sheet1!$A$1,0,0,MATCH("*",Sheet1!$A$1:$A$300,-1),1)
Now in the cell immediately below the last hidden row use Data Validation and for the List Source use =MyList
[EDIT] Adapted version for Excel 2007+ (couldn't test on 2010 though but AFAIK, there is nothing really specific to a version).
Let's say your data source is on Sheet2!A1:A300
and let's assume your validation list (aka autocomplete) is on cell Sheet1!A1
.
Create a dynamic named range MyList
that will depend on the value of the cell where you put the validation
=OFFSET(Sheet2!$A$1,MATCH(Sheet1!$A$1&"*",Sheet2!$A$1:$A$300,0)-1,0,COUNTA(Sheet2!$A:$A))
Add the validation list on cell Sheet1!A1
that will refert to the list =MyList
Caveats
This is not a real autocomplete as you have to type first and then click on the validation arrow : the list will then begin at the first matching element of your list
The list will go till the end of your data. If you want to be more precise (keep in the list only the matching elements), you can change the COUNTA
with a SUMLPRODUCT
that will calculate the number of matching elements
Your source list must be sorted
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…