Consulting

Results 1 to 4 of 4

Thread: Using Shape to control spin button

  1. #1

    Using Shape to control spin button

    Hi is anybody able to tell me how i can use shapes to control a spin button please, after hour & hours I am still unable to find out how this is done. I wish to hide the spin button and control the functions Up & Down using shapes but I dont know how to code this. Sorry for my lack of knowlegde. Thank you in advance.

    Private Sub SpinButton1_Change()
    Text.Value = SpinButton1.Value
    End Sub
    Last edited by Aussiebear; 07-09-2022 at 04:58 PM. Reason: Added code tags to supplied code

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,093
    Location
    To use a shape click to increase the value by e.g. 5

    Sub UP()
    Dim lngVal As Long
    Dim osld As Slide
    Set osld = SlideShowWindows(1).View.Slide
    lngVal = osld.Shapes("SpinButton1").OLEFormat.Object.Value
    osld.Shapes("SpinButton1").OLEFormat.Object.Value = lngVal + 5
    End Sub
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  3. #3
    Hi John

    Thanks a million for your reply this great work thank you, I have inserted your code and it works fine, I will be able to use this although, I was wondering if there is any way to make the numbers increase constantly like using the spin button. If there is not or it is too much coding, then please don’t worry. And once again thank you.

  4. #4
    Private Sub spin_days_Change()
    txt_days.Value = spin_days.Value
    End Sub
    
    Sub UP()
    Dim lngVal As Long
    Dim osld As Slide
    Set osld = SlideShowWindows(1).View.Slide
    lngVal = osld.Shapes("spin_days").OLEFormat.Object.Value
    osld.Shapes("spin_days").OLEFormat.Object.Value = lngVal + 6
    End Sub
    
    Sub DOWN()
    Dim lngVal As Long
    Dim osld As Slide
    Set osld = SlideShowWindows(1).View.Slide
    lngVal = osld.Shapes("spin_days").OLEFormat.Object.Value
    osld.Shapes("spin_days").OLEFormat.Object.Value = lngVal - 6
    End Sub
    Last edited by Aussiebear; 07-10-2022 at 04:50 PM. 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
  •