ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SpinButton1.Max quick question (https://www.excelbanter.com/excel-programming/365938-spinbutton1-max-quick-question.html)

[email protected]

SpinButton1.Max quick question
 
I'm just learning VBA so try and bear with me a little but here's my
question.
I've got 1 cell (9,2) that has an arbitrary number and I've got 4 spin
buttons that subtract from that number so if I raise the value 1 in all
4 spin boxes the value in cell 9,2 will subtract 4. I was trying to
figure out how to stop all the spin buttons from working once cell 9,2
reaches 0 but activating them if the number is changed above zero. This
is what I've got so far it work but then if the number in 9,2 increases
the button doesn't work
Cell 4,2 is the cell that is linked to SpinButton1

Private Sub SpinButton1_Change()
If Cells(9, 2).Value <= 0 Then SpinButton1.Max = Cells(4, 2).Value Else
SpinButton1.Max = 530
End Sub



All times are GMT +1. The time now is 02:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com