Add or remove a value in a drop down list
Cell B3 contains a drop down list (Data Validation). The values in drop down list are from column H. I am using a dynamic named range.
Enter a value in cell E3 and press "Add" button to add the value to the list in column H. You can also remove a value using the "Remove" button.
See the animated gif below.
Create a named range
- Go to tab "Formulas"
- Click "Name Manager" button
- Click "New.."
- Enter List in Name field
- Enter formula in Referes to: field:=Sheet1!$H$3:INDEX(Sheet1!$H$3:$H$1000, COUNTA(Sheet1!$H$3:$H$1000))
- Click Close button
Explaining named range formula
Step 1 - Count the number of cells in a range that are not empty
COUNTA(Sheet1!$H$3:$H$1000) returns 4.
Step 2 - Return a cell reference to a single cell
INDEX(Sheet1!$H$3:$H$1000, COUNTA(Sheet1!$H$3:$H$1000))
becomes
INDEX(Sheet1!$H$3:$H$1000, 4)
and returns
$H$6
Step 3 - Create a cell reference to a cell range
=Sheet1!$H$3:INDEX(Sheet1!$H$3:$H$1000, COUNTA(Sheet1!$H$3:$H$1000))
returns =Sheet1!$H$3:$H$6
That is the cell reference to all the values in column H.
Populate drop down list
- Select cell B3
- Go to tab "Data"
- Click "Data Validation" button
- Click "Data Validation..."
- Select List in "Allow:" field
- Type =List in source: field
- Click OK.
Add vba code
- Press Alt + F11
- Right click on your workbook in the project explorer
- Click "Insert" and then "Module"
- Paste macros to code module
Sub AddValue()
Dim i As Single
i = Worksheets("Sheet1").Range("H" & Rows.Count).End(xlUp).Row + 1
With Worksheets("Sheet1")
.Range("H" & i) = .Range("E3")
.Range("E3") = ""
End With
End Sub
Sub RemoveValue()
Dim i As Single
Dim Cell As Range
i = Worksheets("Sheet1").Range("H" & Rows.Count).End(xlUp).Row
Set Cell = Worksheets("Sheet1").Range("H" & i)
Do Until Cell.Row = 2
If Worksheets("Sheet1").Range("E3") = Cell And Cell <> "" Then
Cell.Delete Shift:=xlUp
Worksheets("Sheet1").Range("E3") = ""
Exit Sub
End If
Set Cell = Cell.Offset(-1, 0)
Loop
MsgBox "Can´t find value: " & Worksheets("Sheet1").Range("E3")
End SubAssign macros to buttons
- Go to tab "Developer"
- Click "Insert" button
- Select "Button" (form control)
- Create a button
- Enter button text: Add
- Assign macro AddValue() to button
Create a remove button and assign RemoveValue() macro.
Download excel file
Add or remove a value in a drop down list.xlsm
Related posts:
Excel charts: Use dynamic ranges to add new values to both chart and drop down list
Dependent drop down lists – Enable/Disable selection filter
Quickly filter a column in an excel table
Create a drop down list containing alphabetically sorted values in excel
Use a drop down list to extract and concatenate unique distinct values


















We have problem with drop list if you remove the first name of the list may be we can change to:
=OFFSET(Sheet1!$H$2:INDEX(Sheet1!$H$3:$H$990,COUNTA(Sheet1!$H$3:$H$990)-1),1,)
Jacky Harle,
=OFFSET(Sheet1!$H$3, 0, 0, COUNTA(Sheet1!$H$3:$H$1000))