+ Reply to Thread
Results 1 to 2 of 2

Spin button in a work sheet - how do I make it work?

  1. #1

    Spin button in a work sheet - how do I make it work?

    I can enter the spin button into a worksheet. However, I cannot get it to
    change the target cell for changing values up or down. Do I need to write a
    macro to do this for the spin button? If someone could walk me through one
    of the ACTIVEX controls, I believe I could handle the remaining ones.

    Thanks

    Mike Moore

  2. #2
    John Mansfield
    Guest

    RE: Spin button in a work sheet - how do I make it work?

    Mike,

    Assuming you are working with ACTIVEX controls and not the Forms controls .
    .. .

    To add a spinbutton to your worksheet:

    View -> Toolbars -> Control Toolbor
    Cick on the Controls Toolbox Design icon is activated, or in "Design Mode"
    Drag the spin button from the Control Toolbar onto your worksheet
    Click on the spin button once
    Right-click on your mouse and select "Properties"
    The most important fields are probably the spin button name, linked cell,
    max, and min.
    Set the linked cell, max, and min
    When complete, deactivate the design mode on the Controls Toolbar

    Assuming the sheet where the spinbutton resides is called "sheet1", you can
    further control the spin button via VBA. This example shows spinup and
    spindown procedures for a spin button named "Spinbutton1". The procedures
    set the minimum and maximum values for the value in cell A1:

    Private Sub SpinButton1_SpinDown()
    With Range("A1")
    .Value = WorksheetFunction.Max(-0.2, .Value - 0.001)
    End With

    End Sub
    Private Sub SpinButton1_SpinUp()
    With Range("A1")
    .Value = WorksheetFunction.Min(0.2, .Value + 0.001)
    End With
    End Sub

    Hope this helps.

    ----
    Regards,
    John Mansfield
    http://www.pdbook.com

    "[email protected]" wrote:

    > I can enter the spin button into a worksheet. However, I cannot get it to
    > change the target cell for changing values up or down. Do I need to write a
    > macro to do this for the spin button? If someone could walk me through one
    > of the ACTIVEX controls, I believe I could handle the remaining ones.
    >
    > Thanks
    >
    > Mike Moore


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1