+ Reply to Thread
Results 1 to 5 of 5

Excel 2010: Multiple spinners using same macro

  1. #1
    Forum Contributor
    Join Date
    08-29-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    103

    Excel 2010: Multiple spinners using same macro

    I have a sheet with about 100 spinners for 100 different cells as part of a character sheet (I'm attempting to make a iPad friendly version). Anyway, I have one formula for setting the min/max for each cell and it's rather simple:

    Please Login or Register  to view this content.
    Works flawlessly on spinner 484. Now when I open the other spinners and assign them a macro and change it to Spinner_484, it does not work. The MAX is set to either 2 or 5 in the rest of the squares strangely enough, because they had no value before then. Any ideas what's happening?



    And another thing, separate issue, in Excel 2010, if you open up multiple worksheet with macros and run a macro on one sheet, it f's up everything on your other sheet! Very upset about this, as Excel 2003 and earlier did not have this problem. I came back to my sheet and found all spinners displaced in a new spot, and when I tried to move them, they had a duplicate spinner directly below them that gave a vague error (the duplicate did) to having no macro assigned when I tried to increase/decrease it's value. I was hoping to use the top spinners which have individual macros assigned to each and every one of them, but they also got f'd up by this "bug" in Excel and I'd either have to "Assign" and code a separate macro, again, to each and every spinner, or just assign a single macro to all spinners since it does the same thing (hence the first part of my question).


    One final thing. When working with vba and I go back to my main worksheet, there is no longer any cells displayed on the left hand side where defined "names" and cell blocks usually show up. I have to hit cntl-F2 twice to get them to show up. Any ideas why this is happening in Excel 2010? Never had any of these issues before using old Excel.

  2. #2
    Forum Contributor
    Join Date
    08-29-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    103

    Re: Excel 2010: Multiple spinners using same macro

    Okay, it seems each spinner has a unique ID like it does in Visual Basic .net, i.e. Spinner_484 is it's own item, however in vba in Excel under it's properties and in vba, its name is not listed whatsoever.

    I found this out by deleting all spinners but the one that worked, then I copied that one spinner to all 100-cells, then in Format Control, Cell Link, I assigned the proper cell to each spinner. Then I went to change the max value of the spinner and it was still stuck at '1'. I was perplexed, so I changed my code above to Sub Spinner001_Change(), and Set 0Spinner to "Spinner 001" and got the following error:

    Run-time error 'lots of numbers ()'
    The item with the specified name wasn't found.
    So obviously, the code won't work because its looking for the physical spinner 001, which is completely bogus because Excel does not list the spinner id's anywhere . Is there another way to use the code to set the max value of the spinner being used to the fluctuating value it needs to be so I don't have to recycle the same code for each and every physical spinner?

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

    Re: Excel 2010: Multiple spinners using same macro

    Hello Taemex,

    While this macro works for the PC programming environment, I can not say the same holds true for Apple products. But, give it a try anyway.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  4. #4
    Forum Contributor
    Join Date
    08-29-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    103

    Re: Excel 2010: Multiple spinners using same macro

    You're a gentleman and a scholar! That worked! Such a simple code. I'll mark this as solved, but I do have a question:

    So, "application.caller" works with any event that calls a macro if the object is assigned one in Excel?

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

    Re: Excel 2010: Multiple spinners using same macro

    Hello Taemex,


    Application.Caller returns the name of the object on the worksheet that "called" the macro.

+ 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. [SOLVED] Macro needed for multiple Find and Replace in Excel 2010
    By litwinj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-09-2014, 03:43 PM
  2. [SOLVED] Excel 2010 - Macro to join 5 rows with multiple cells to one row
    By fiesty in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-12-2013, 09:49 PM
  3. Excel Macro (excel for mac 2010) - update multiple excel books on criteria
    By genichigo in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2012, 07:23 AM
  4. Excel 2010 multiple worksheets print to multiple pdf 's is there a macro for this?
    By fontana in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-19-2012, 01:40 PM
  5. Excel 2010 Macro -how to split worksheet into multiple files
    By kbustin in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-01-2012, 10:39 AM

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