PDA

View Full Version : Spin Button



Billbill
07-07-2022, 02:42 PM
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

Paul_Hossler
07-07-2022, 05:11 PM
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

29916

Billbill
07-08-2022, 12:02 AM
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