Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Enable/Disable Macros Pop-Up juamig Excel Discussion (Misc queries) 1 April 9th 10 06:29 PM
Enable/Disable Macros Ben Schaum Excel Discussion (Misc queries) 1 January 21st 05 03:42 PM
Enable/Disable Button surplusbc[_6_] Excel Programming 1 February 1st 04 09:53 PM
macro disable and enable. paul[_12_] Excel Programming 1 January 9th 04 01:29 PM
Enable/Disable Macros Joseph[_6_] Excel Programming 3 August 23rd 03 02:54 PM


All times are GMT +1. The time now is 10:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"