SpinButton Enable/Disable

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

Does anyone know if a spinbutton can be disabled by its up or down button
only (e.g. disable its up button when it reaches its max value, but keeping
its down button enable)? If so how?

Please note I am using Excel 97.

Thanks in advance.

MikeL
 
Mike,

Wouldn't have thought so, it is a property of the control, not part of the
control.

You would normally just test if the value is already the max, and if so,
ignore the up in this case.


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Whether excel97 or higher it is not possible to disable only one of the
buttons of SpinButton.
What you can do is:-

Add a blank image on the up arrow button covering it (Image1).
Then following code:-

Private Sub SpinButton1_Change()
If SpinButton1.Value = SpinButton1.Max Then
Image1.Visible = True
Else
Image1.Visible = False
End If
End Sub


Private Sub SpinButton1_SpinUp()
'if spinbutton is in a worksheet
SpinButton1.BottomRightCell.Select

'or if it is on a userform
'something_else.SetFocus
End Sub

Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top