• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

SOLVED: VBA code to change, via radio button, increment of a Form spinner control?

lingyai

New Member
I wonder if this is even possble...I'm using Excel 2010 if that matters, and also I don't want an xml solution as some users could be on Macs.

Let's say I have a Form spinner control, linked to (i.e. controlling) a cell which must not be typed in.

It makes the linked cell increment by X, where I have to set X manually by right clicking the spinner, going to Format Control / Control tab, and changing the Incremental change value.

Now, if for example I am incrementing something which is denominated in 1000s, and the form's default increment is 1, I have to change it manually because, by sticking with the default of 1, I'd have to click forever just to get to 1,000, much less to 9,999.

What about this? Next to the spinner control would be, say, 4 radio buttons: "1000s", "100s", "10s", and "1s".

Clicking the "1000s" radio button would change the spinner's increment to 1000; clicking the "100s" button would change it to 100; etc.

So if at the outset the result in the linked cell was 0, and I quickly wanted the target cell to display a value of 5,301 -- again, this cell may not be typed in -- I would do it by clicking the "1000s" button 5 times, then the "100s" button 3 times, leave the "10s" button alone, and click the "1s" once. And of course the target cell updates which each click.

I know it sounds like a very stilted way to enter a number, but there's a reason I'm asking.

Is this even doable? I guess it boils down to whether you can change the increment via code rather than manually.
 
You have a Slider and a Spinner

I wouldn't look to change the incremental control of the tools

What you can do is change an intermediate cell

eg: Say the Slider is linked to A1
Say the Spinner is linked to A2

Then in A3 use something like =A1+10^A2

Link all calculations to A3

Using this approach will work on all platforms

If you supply a sample file with samples of ranges you want we could give a more targeted solution
 
lingyai - hmmm?
Spinbuttons .. okay
Radiobuttons ... You would check somewhere how do those work

Sample has one possible to do this with spinbuttons.
 

Attachments

  • lingyai.xlsx
    36.4 KB · Views: 1
Thanks guys. Meanwhile I think I've solved it... by ... uhm, actually trying it:rolleyes:
 

Attachments

  • Control spinner increments via code (spinners)_SOLVED.xlsm
    19.9 KB · Views: 2
Back
Top