Consulting

Results 1 to 3 of 3

Thread: Spin Button

  1. #1

    Post Spin Button

    Hi
    I have the spin button doing exactly what l want it to do.
    My question is that l need the spin button, up & down to be separated
    l need the up on the top right & the down on the top left of the screen
    Is this even possible to do, can l separate these buttons?
    l have spent hours trying to find a solution with no luck. Thank you

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,724
    Location
    Spin Buttons don't work that way

    As a possible work-around you could use 2 shapes with an Action Setting to run macros that emulate the spin button actions

    Capture.JPG
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    Hi Paul thank you so much for your reply

    I have already done what you suggested & it works well, the problem is that I cannot make it spin like a spin button is there code that can make this happen ?
    At the moment I can only advance by +1 or minus -1 at a time
    I really dont have a clue how to do this.
    I have attached the working code. Any help would be really appreciated.

    Sub addNumericValueToTextFields()
    
    Dim textFieldValue As Integer
    Dim inputBoxValue As Integer
    Dim newValue As Integer
    
    textFieldValue = Int(ActivePresentation.Slides(28).Shapes("Counter").TextFrame.TextRange.Text)
    
    newValue = textFieldValue + 1
    ActivePresentation.Slides(28).Shapes("Counter").TextFrame.TextRange = newValue
    
    If newValue > 1949 Then
    MsgBox "You have reach the limit", vbSystemModal, "Limit"
    End If
    
    End Sub
    
    Sub delNumericValueToTextFields()
    
    Dim textFieldValue As Integer
    Dim inputBoxValue As Integer
    Dim newValue As Integer
    
    textFieldValue = Int(ActivePresentation.Slides(28).Shapes("Counter").TextFrame.TextRange.Text)
    
    newValue = textFieldValue - 1
    ActivePresentation.Slides(28).Shapes("Counter").TextFrame.TextRange = newValue
    
    If newValue < 1931 Then
    MsgBox "You have reach the limit", vbSystemModal, "Limit"
    End If
    End Sub
    Last edited by Aussiebear; 07-08-2022 at 02:21 AM. Reason: Added code tags to supplied code

Tags for this Thread

Posting Permissions

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