By: Md. Abu Sina Ibne Albaruni

In reply to BENJAMIN THORPE.

Dear BENJAMIN THORPE

Thank you very much for your interest in our article. You can create an auto-prompt dropdown in Excel. In the dataset, we have the names of multiple people.

Simply follow the steps below:

● Go to the Developer tab >> Insert >> Combo Box (ActiveX Control).
● Then place the newly created ComboBox.

● Double-click on the ComboBox.
● A VBA window will pop up. Paste the following code into the window.

Private Sub ComboBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean)

'variable declaration
Dim myRng As Range
Dim myArr() As Variant
Dim i As Long

'user input
Set myRng = Application.InputBox("Insert the Data Range for the Drop-down List", Type:=8)

myArr = myRng.Value

'sort selected data
For i = LBound(myArr, 1) To UBound(myArr, 1) - 1
For j = i + 1 To UBound(myArr, 1)
If myArr(i, 1) > myArr(j, 1) Then
Dim temp As Variant
temp = myArr(i, 1)
myArr(i, 1) = myArr(j, 1)
myArr(j, 1) = temp
End If
Next j
Next i

'clear Drop-down list
ComboBox1.Clear

'add item to the drop-down list
For i = LBound(myArr, 1) To UBound(myArr, 1)
ComboBox1.AddItem myArr(i, 1)
Next i

End Sub

● Now, go back to the worksheet and click on the Design Mode from the Developer tab to turn it off.

● Double-click on the ComboBox and you will see an InputBox asking for the list.
● Select the list from your dataset and press OK.

● You will have the auto-prompt drop-down list.

You can also download the Excel file from here.
Excel Auto Prompt Drop-Down.xlsm

If you have any more queries, please let us know in the comments.

Regards
Md. Abu Sina Ibne Albaruni
Team ExcelDemy