locked
Multiple SpinButtons RRS feed

  • Question

  • I want to use over a hundred spinUp/SpinDown buttons in random cells. Following is an example of three. Is there an easier way?

    Private Sub SpinButton9_SpinDown()
    Range("G9").Value = Range("G9").Value - 0.00002
    End Sub
    Private Sub SpinButton9_SpinUp()
    Range("G9").Value = Range("G9").Value + 0.00002
    End Sub
    Private Sub SpinButton28_SpinDown()
    Range("G28").Value = Range("G28").Value - 0.00002
    End Sub
    Private Sub SpinButton28_SpinUp()
    Range("G28").Value = Range("G28").Value + 0.00002
    End Sub
    Private Sub SpinButton51_SpinDown()
    Range("G51").Value = Range("G51").Value - 0.00002
    End Sub
    Private Sub SpinButton51_SpinUp()
    Range("G51").Value = Range("G51").Value + 0.00002
    End Sub

    Tuesday, February 17, 2015 4:33 PM

Answers

  • You could set the linked cell of the spin button to another cell and use a formula in the cell you want to control.

    For example, set the linked cell of the spin button associated with cell G9 to the cell K9.

    In G9, enter the formula =K9*0.00002

    No VBA code needed at all.

    You can hide the column(s) with the linked cells if you wish.


    Regards, Hans Vogelaar (http://www.eileenslounge.com)

    Tuesday, February 17, 2015 7:21 PM