Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
SpinButton Enable/Disable
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
SpinButton Enable/Disable
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) "MikeL" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
SpinButton Enable/Disable
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 *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
SpinButton Enable/Disable
Thanks Sharad.
Will try your code later. MikeL "Sharad" wrote: 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 *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Enable/Disable Macros Pop-Up | Excel Discussion (Misc queries) | |||
Enable/Disable Macros | Excel Discussion (Misc queries) | |||
Enable/Disable Button | Excel Programming | |||
macro disable and enable. | Excel Programming | |||
Enable/Disable Macros | Excel Programming |