+ Reply to Thread
Results 1 to 4 of 4

spin buttons

  1. #1
    Registered User
    Join Date
    08-09-2007
    Posts
    1

    spin buttons

    I made a spin button linked to a cell with a Max of 100 and Min of -100, and a small change of 1, however, when I go below 0 the number turns to 65,535 and does not go negative at all. I need it to go down from 0 to -1, to -2, and so on. Does anyone know how to fix this?

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello Svay,

    Since the Spin Button only works with positive numbers, you can do a little number magic to get the negative values. This is basically 2's complement math. Set the Min value to 1 and the Max value to 201. You will need a conversion routine to translate the positive values into zero and negative numbers. Place this macro in a Standard VBA module. Call GetSpinValue() in your code to retrieve the positive/negative results.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross
    Last edited by Leith Ross; 08-09-2007 at 12:24 PM.

  3. #3
    Registered User
    Join Date
    07-28-2008
    Location
    Canada
    Posts
    22

    Spin value (negative numbers)

    Hi Leith - I saw your post to svay re; negative numbers using the spin button when modelling out scenarios

    I copy pasted it for my own records .. thanks

    I have 2 questions for you ...

    to "get this working" .. do I
    1) right click the tab on the worksheet and then scroll up to "view Code" ??
    2) then copy paste in there ?

    and the 2nd question I have for you is .. does this AUTOMATICALLY appy to ALL spin buttons within that tab within the worksheet ?.. what I mean is I have a NUMBER of spin buttons that I would like to have go into the negative values ... in fact 14 on one page/tab ... how would I go about permitting the negative values on each spin button ?


    Thanks for your help in this complex question

    atlus

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello atlus,

    You should have started a new thread and refernced this post in the new thread. To learn more about how to post, please click on this link Forum Rules.

    You situation and the original poster's don't appear to be the same. Can you explain more about how this Spinners are used on the worksheet? What range of numbers are they using?

    Sincerely,
    Leith Ross

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1