+ Reply to Thread
Results 1 to 10 of 10

Spin Button Using Multiple Active Cells

  1. #1
    Registered User
    Join Date
    07-10-2014
    Location
    Kansas
    MS-Off Ver
    2013/2013
    Posts
    5

    Exclamation Spin Button Using Multiple Active Cells

    I have an excel sheet with numerous columns/rows of data. I want to be able to adjust multiple active cells simultaneously using either a Button or Spin Button.

    Adjusting a single cell is not trivial, but it is adjusting multiple active cells (range of which can/will change) that I have reached my dilemma.

    Here is what I'm using to adjust a single active cell with a Spin Button:

    Please Login or Register  to view this content.

    Any suggestions? Is using multiple (user chosen) active cells even possible?

    Thanks

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,755

    Re: Spin Button Using Multiple Active Cells

    Actually adjusting a single cell is trivial if you set the LinkedCell property of the spin button to that cell, if you always want to adjust the same cell.

    The code you have works perfectly well when the user has selected multiple cells. Have you tried it?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    07-10-2014
    Location
    Kansas
    MS-Off Ver
    2013/2013
    Posts
    5

    Re: Spin Button Using Multiple Active Cells

    Yes, I was and it was not working. What specific spin button are you using, and what version of excel?

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,755

    Re: Spin Button Using Multiple Active Cells

    ActiveX spin button and Excel 2010. See attached. Multiple cells will be selected when you open it, just click the spin button.

    Also, not sure why you have this line of code. It's not necessary in this situation, but I left your code exactly as is in this file.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    07-10-2014
    Location
    Kansas
    MS-Off Ver
    2013/2013
    Posts
    5

    Re: Spin Button Using Multiple Active Cells

    Is not working in Office 2013 or 2014. Single cell selection and changing works, but not multiple (same as I described in the initial post).

    Any idea if it's a version difference? Any way to run Excel as a previous version?

    Or, what has changed in the programming from 2010 to 2013/2014 to cause this not to work?

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,755

    Re: Spin Button Using Multiple Active Cells

    I opened this on my other machine that runs Excel 2013 and the only problem I had was an invalid call error on this line

    Please Login or Register  to view this content.
    When I commented it out, everything ran fine.

    Exactly what steps are you taking to select multiple cells? What OS are you using?

  7. #7
    Registered User
    Join Date
    07-10-2014
    Location
    Kansas
    MS-Off Ver
    2013/2013
    Posts
    5

    Re: Spin Button Using Multiple Active Cells

    I was either dragging to select cells, or using shift-click to highlight multiple cells and that does not work. However, I do now see if I use Control-click for multiple cells it does work.

    My dilemma now is that it changes the entire selection to the same number. It does not simply add 1 to each value.

    I.e. row with: 5 4 6
    Does not become: 6 5 7

  8. #8
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,755

    Re: Spin Button Using Multiple Active Cells

    I did some further tests on this and found that some selections work but some do not. I can't see what is the difference. But I solved it with this:

    Please Login or Register  to view this content.
    Edit: This will also solve your problem of all cells being set to the same number.

  9. #9
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Spin Button Using Multiple Active Cells

    You could use a Forms spin button and assign it to this macro. Press the up button and all cells in the Selection will be incremented by 1, if down, decrimented.
    As written it will effect all cells, treating those with text as 0. It can be altered to effect only cells that already have numbers.

    Please Login or Register  to view this content.
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  10. #10
    Registered User
    Join Date
    07-10-2014
    Location
    Kansas
    MS-Off Ver
    2013/2013
    Posts
    5

    Re: Spin Button Using Multiple Active Cells

    Thanks 6StringJazzer, that code works just as I had hoped.

    Repped!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Linking Spin Button to active cell in worksheet
    By jlw446 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-15-2019, 12:23 AM
  2. spin button: create multiple cell link
    By DavidRoger in forum Excel General
    Replies: 5
    Last Post: 04-30-2014, 05:44 AM
  3. Excel 2007 : Spin button
    By leeroy2612 in forum Excel General
    Replies: 4
    Last Post: 11-27-2011, 11:28 AM
  4. Replies: 2
    Last Post: 03-12-2008, 06:52 PM
  5. Spin Button:spin cells A7
    By ice in forum Excel General
    Replies: 1
    Last Post: 03-16-2007, 02:23 PM

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