XL98: Min Can Exceed Max on Scroll Bar or SpinButton Control

ID: Q183184

The information in this article applies to:

SYMPTOMS

You can set the Min property to a value that is greater than the value for the Max property for the ScrollBar and SpinButton controls.

STATUS

This behavior is by design of Microsoft Excel 98.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact the Microsoft fee-based consulting line at (800) 936-5200. For more information about the support options available from Microsoft, please see the following page on the World Wide Web:

   http://www.microsoft.com/support/supportnet/refguide/

When you set the Min property to a value that is greater than the value for the Max property, the default behavior of the control is reversed. When this behavior occurs, clicking the arrow that points upward on a SpinButton control decreases the value of the SpinButton instead of increasing the value.

Example

To see an example of the behavior, follow these steps:

 1. Close and save any open workbooks, and then create a new workbook.

 2. Start the Visual Basic Editor (press OPTION+F11).

 3. On the Insert menu, click UserForm.

 4. Draw a Label control on the UserForm.

 5. Draw a SpinButton control on the UserForm.

 6. Switch to the Properties window (press F6).

 7. Change the following properties for the SpinButton control to the
    following values.

       Property      Value
       ---------------------------------------

       Orientation   0 - fmOrientationVertical
       Min           100
       Max           50
       Value         75

 8. Double-click the SpinButton to display the Code window for the
    UserForm.

 9. In the module, type the following code for the SpinButton1 Change
    event:

       Private Sub SpinButton1_Change()

           ' Set the Caption of the label to the value of the SpinButton.
           Label1.Caption = SpinButton1.Value

       End Sub

10. Run the UserForm.

   When you click the upward pointing arrow on the SpinButton, the value in
   the label is decreased. This behavior is the result of setting the Min
   property of the SpinButton to a value that is greater than the value for
   the Max property.

11. Close the UserForm.

NOTE: This behavior also occurs in a ScrollBar or a SpinButton control that you place on a worksheet.

REFERENCES

For more information about SpinButtons, click the Office Assistant while in the Visual Basic Editor, type "spinbutton," click Search, and then click to view "SpinButton Control."

For more information about Scrollbar Controls, click the Office Assistant while in the Visual Basic Editor, type "scrollbar," click Search, and then click to view "ScrollBar Control."

NOTE: If the Assistant is hidden, click the Office Assistant button on the Standard toolbar. If Microsoft Help is not installed on your computer, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q179216
   TITLE     : OFF98: How to Use the Microsoft Office Installer Program

Additional query words: XL98 scroll bar spin button
Keywords          : kbprg kbdta xlui xlvbahowto xlvbainfo 
Version           : MACINTOSH:98
Platform          : MACINTOSH
Issue type        : kbhowto

Last Reviewed: May 18, 1999