VBA & Macro Problems

Use Excel Spin Buttons to Control a Dropdown List

Nimra MalikNimra Malik Nov 18, 2026 869 views

Question details

The user wants to use spin buttons to move through the choices in an Excel dropdown list.

Use Excel Spin Buttons to Control a Dropdown List
Product
Microsoft Excel
Device & OS
not provided
Scenario
A worksheet has a data validation dropdown, and the user wants spin button clicks to change its selected value.
Observed behavior
The desired result is for each spin button click to select the previous or next list item in the dropdown cell.
Before you start

Use desktop Excel and make sure the Developer tab is available; Excel for the web cannot run VBA macros. The example below uses Sheet1, dropdown cell A2, linked cell B2, and five list items in E2:E6.

Solution 1Recommended

Assign a VBA macro to a Form Control spin button

Use a linked cell to track the list position and a macro to write the corresponding item into the dropdown cell.

1
Create the dropdown list

Enter five choices in Sheet1 cells E2:E6. Select A2, choose Data > Data Validation, select List, and set the source to =$E$2:$E$6.

2
Insert and configure the spin button

Choose Developer > Insert > Spin Button under Form Controls and draw it on Sheet1. Right-click the control, choose Format Control, and on the Control tab set Minimum value to 1, Maximum value to 5, Incremental change to 1, and Cell link to $B$2.

3
Add the macro

Open Developer > Visual Basic, choose Insert > Module, and paste this code: Sub SpinSelect() Dim ws As Worksheet Dim position As Long Set ws = ThisWorkbook.Worksheets("Sheet1") position = CLng(ws.Range("B2").Value) If position >= 1 And position <= 5 Then ws.Range("A2").Value = ws.Range("E2").Cells(position, 1).Value End If End Sub

4
Assign and test the macro

Return to Sheet1, right-click the spin button, choose Assign Macro, and select SpinSelect. Set B2 to 1 and select the first list item in A2, then click the spin button arrows to move through the list.

5
Save the workbook

Choose File > Save As and select Excel Macro-Enabled Workbook (*.xlsm). When reopening a trusted workbook, enable its macros if prompted.

Assign a VBA macro to a Form Control spin button
Keep the list and control in sync: If you change the list length, update the spin button maximum and the position limit in the macro. The example does not update B2 when you manually choose a different item from the dropdown.
Free Microsoft Office alternative

Work with Excel spreadsheets in WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for opening and editing spreadsheets. Its support for common Excel formats makes it easy to move everyday files between suites; test VBA and spin button behavior separately, as compatibility may vary.

Create and edit spreadsheets with a familiar interfaceOpen and save common Microsoft Excel formats, including XLSX and XLSWork with spreadsheet lists and data validation for everyday selection tasksUse a free, lightweight suite for documents, spreadsheets, and presentations
microsoft office alternative - wps office

Frequently Asked Questions

Can a spin button directly change a data validation dropdown?

A Form Control spin button changes its linked cell, not the dropdown selection directly. Assign a macro to the button to read the linked position and write the corresponding list item into the dropdown cell.

Why does manually selecting a dropdown item leave the spin button out of sync?

The example macro updates A2 when the spin button is clicked, but it does not update B2 when A2 is changed manually. Additional VBA is needed to synchronize changes in both directions.

How do I use a longer or shorter list?

Update the Data Validation source, change the Maximum value under the spin button's Format Control settings, and adjust the position limit in the macro to match the number of list items.

Why does the macro disappear when I save the file?

The standard XLSX format does not retain VBA macros. Choose File > Save As and save the workbook as an Excel Macro-Enabled Workbook (*.xlsm).