![]() |
|
#1
|
|||
|
|||
|
Problem 1: The cell D4 value increases or decreases by 2 when the spinbutton is clicked. The spinbutton is an activex control named "Spindays".
Problem 2: The value will go below 0 (ex. -1), even though the property Min is set to 0. What did I miss? Thanks for your help. The code is below. - DL Private Sub SpinDays_SpinDown() With Range("D4") .Value = Range("D4").Value - 1 End With End Sub Private Sub SpinDays_SpinUp() With Range("D4") .Value = Range("D4").Value + 1 End With End Sub |
|
#2
|
|||
|
|||
|
UPDATE
I worked around this by using a simple form control, instead of the active x control. However, I am still interested in knowing why my code is not working. Your thoughts would be appreciated. Thanks |
|
#3
|
||||
|
||||
|
I'd have thought you could use something like:
Code:
Private Sub SpinDays_SpinDown()
With Range("D4")
If .Value = 0 Then Exit Sub
.Value = .Value - 1
End With
End Sub
Private Sub SpinDays_SpinUp()
With Range("D4")
.Value = .Value + 1
End With
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#4
|
|||
|
|||
|
Thank you, that will work.
-DL |
|
| Tags |
| activex control, increment value, spinbutton |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
multiply by incrementing by 5s
|
marynomore | Excel | 2 | 03-27-2013 05:36 AM |