How to Rotate Spin Button in Excel (With Easy Steps)

In this article, we will demonstrate how to insert and rotate a spin button in Excel to change a value.


What Is a Spin Button?

A Spin Button is a form element that allows you to easily increase or decrease a value, like incrementing a number, date, or time. By clicking the up arrow, the value can be increased; and by clicking the down arrow, it can be decreased. A Spin Button can be used as form of Data Validation to avoid typing a value in a cell.

Spin Buttons in Excel

We have two forms of Spin Buttons in Excel, which can be found in the Developer tab under the Insert group. The Spin Button presented in the Form Controls group can be assigned directly to a cell but can’t be rotated. The Spin Button presented in the ActiveX Control group can be rotated, however some VBA code is required to assign it to a cell.

In this article, we will use the Spin Button presented in the ActiveX Control group.

Read More: How to Use Spin Button in Excel


Step-by-Step Procedures to Rotate a Spin Button in Excel

Step 1 – Making a Dataset

To demonstrate the use of a Spin Button, we’ll use the following dataset, which has values for Monthly Salary and Additional Monthly Earnings. First, we’ll find the Yearly Earnings.

Making Datatset to Rotate Spin Button Excel

  • Enter the following formula in cell C6:
=(C4*12)+(C5*12)

  • Press ENTER to return the result.

Next, we’ll insert a Spin Button and assign it to cell C5, so that every time we click on the spin button, the value of C5 (Additional Monthly Earning) will change, and accordingly, so will the value of the Yearly Earnings.


Step 2 – Inserting a Spin Button from Form Controls

Let’s insert a Spin Button.

  • Go to the Developer tab >> click on Insert.
  • From the ActiveX Control group, click on the Spin Button marked in the image below with a red box.

Inserting Spin Button to Rotate Spin Button Excel

  • Place the Spin Button next to the dataset.


Step 3 – Rotating the Spin Button

Now we’ll rotate our Spin Button.

  • Click on the Spin Button.

A dragging arrow appears at the bottom right corner of the Spin Button.

  • Drag the Spin Button with this arrow, and rotate it to either the horizontal or vertical position.

Dragging Spin Button to Rotate Spin Button Excel

We have rotated the Spin Button.

Here is a visual walkthrough of the process:


Step 4 – Inserting VBA Code

Now we’ll assign some code to the Spin Button so that every time we click on a button, the value of the dataset changes. In this case, we want to change the value of cell C5 with the Spin Button.

  • Right-click on the Spin Button.
  • From the Context Menu, select View Code.

Applying VBA to Rotate Spin Button Excel

A VBA Editor window will appear.

  • Enter the following code in the VBA Editor window:
Private Sub SpinButton1_SpinUp()
   With Range("C5")
    .Value = WorksheetFunction.Min(1000, .Value + 50)
 End With
End Sub
Private Sub SpinButton1_SpinDown()
  With Range("C5")
       .Value = WorksheetFunction.Max(300, .Value - 50)
     End With
End Sub

  • Save the code.
  • Run the code.

  • Return to the worksheet and click on the Spin Button.

The value in cell C5 changes every time we click on the Spin Button, as does the Yearly Earnings.

Read More: How to Control Multiple Cells with Spin Button in Excel


Download Workbook


Related Articles

Get FREE Advanced Excel Exercises with Solutions!
Afia Kona
Afia Kona

Afia Aziz Kona, a graduate of NAME from Bangladesh University of Engineering & Technology, Bangladesh, serves as a technical content creator in the ExcelDemy project. Possessing a passion for innovation and critical thinking, she actively embraces challenges. Beyond her engineering background, Afia exhibits a keen interest in Excel, having authored numerous articles on Excel & VBA-related issues to simplify the experience for users facing obstacles in Excel. Apart from creating Excel tutorials, she is also interested... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo