+ Reply to Thread
Results 1 to 2 of 2

Spin Button to call sub every time it changes

Hybrid View

  1. #1
    Registered User
    Join Date
    05-07-2021
    Location
    Naples, Italy
    MS-Off Ver
    Office 2016
    Posts
    30

    Spin Button to call sub every time it changes

    Hi everyone!

    I hope you are well. I have a spin button on my sheet, linked to a name range on another sheet ("LookUps"), to sort some data and I wish to call a sub every time it changes. Here's my code

    Private Sub sortSpinButton_Change()
        sortTextBox.Value = Worksheets("LookUps").Range("sortBy").Item(sortSpinButton.Value)
        Call sortSht(sortSpinButton.index)
    End Sub
    Every time the user presses the spin button, the "sortTextBox" displays the preference and the sortSht sub executes. However, if the user press a second time either of the spin buttons (Up or Down), the preference displays correctly in the text box but nothing happens.

    What am I missing?


    Many thanks for your support!

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,410

    Re: Spin Button to call sub every time it changes

    whats missing??? - a workbook !
    see big yellow banner - how to upload.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 06-07-2021, 07:03 PM
  2. [SOLVED] Have spin button call macro repeatedly when mouse button is held down
    By czlowiek121 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2019, 12:44 PM
  3. [SOLVED] Increase time using spin button
    By neurion in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-03-2015, 03:34 PM
  4. [SOLVED] Increase decrease time with a spin button
    By forrestgump1980 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-20-2015, 05:30 PM
  5. [SOLVED] Help with Spin Button. Set Spin button starting value based on a text box value
    By etuckram in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 09-18-2014, 10:05 AM
  6. Spin Button for 24hrs time entry
    By Martin Currie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-08-2014, 01:10 PM
  7. How to use spin button to store time in two textboxes
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2009, 08:08 AM

Tags for this Thread

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