+ Reply to Thread
Results 1 to 6 of 6

Macros broken from 2010 to 2013 - example macro inside

  1. #1
    Registered User
    Join Date
    05-13-2014
    MS-Off Ver
    Excel 2013
    Posts
    3

    Macros broken from 2010 to 2013 - example macro inside

    Hello!

    We use a fairly large amount of macros at my company, but I'm having a very strange issue after upgrading from Excel 2010 to Excel 2013. All of my macros have broken! For example, the following macro is used to "merge" two columns of data. This macro works in Excel 2010 but not in 2013.

    Please Login or Register  to view this content.
    Any help would be greatly appreciated!

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

    Re: Macros broken from 2010 to 2013 - example macro inside

    Please explain what "broken" means.

    Does the code run?
    Does it produce error messages? If so, what do the messages say?
    Does it produce unexpected/wrong results?
    Does it hang?

    Also, your profile says you use Excel 2003. Please update your profile to reflect what you are currently using.
    Jeff
    | | |·| |·| |·| |·| | |:| | |·| |·|
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Macros broken from 2010 to 2013 - example macro inside

    I tested your code with excel 2013, no problems on my test sheet
    If solved remember to mark Thread as solved

  4. #4
    Registered User
    Join Date
    05-13-2014
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Macros broken from 2010 to 2013 - example macro inside

    After doing some troubleshooting, it appears that the issue with that I'm having does not stem from the upgrade to 2013, but rather from the fact that I put all of my macros into a "Personal.xlsm" file. When I run the above macro in a regular Sheet or Workbook, the results are fine, but when I run the macro in my Personal.xlsm file, the results are incorrect.

    MY TEST SHEET:

    Column A1: Column B1:

    A "1"
    A "2"
    A "3"
    B "4"
    B "5"
    C "6"

    EXPECTED RESULT (Works when NOT in Personal.xlsm: )


    Column A1: Column B1:

    A "1" "2" "3" (in single cell)
    B "4" "5" (in single cell)
    C "6"

    RESULT WHEN RAN IN "Personal.xlsm" File:

    Column A1: Column B1:

    A "1"
    A "1" "1" "2" (in single cell)
    A "3"
    B "4"
    B "5"
    C "6"
    Last edited by OfTheNaveed; 05-13-2014 at 10:40 AM.

  5. #5
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,720

    Re: Macros broken from 2010 to 2013 - example macro inside

    What kind of module is the code in in the Personal.xlsm file? A Module, or a Sheet?

    You should make Range references explicit. Without qualification it will default to the sheet which owns the code module. If it's not a sheet module but a Module module, then it should default to the active sheet. For example, you may need to change

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    It may be worth your while to stop the code on that line in debug mode and see what the code thinks the active sheet/active workbook is.

  6. #6
    Registered User
    Join Date
    05-13-2014
    MS-Off Ver
    Excel 2013
    Posts
    3

    Re: Macros broken from 2010 to 2013 - example macro inside

    The macro was stored in "ThisWorkbook" on the Personal.xlsm file. I moved it to a Module and the code (and all the other macros) works flawlessly.

    Thank you so much for the help!

+ 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. Macros written in Excel 2010 don't work in Excel 2013
    By Bukovnik in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 09-03-2015, 01:24 AM
  2. [SOLVED] Macro works in 2010&2013 but not Excel 2003
    By Mattiac in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-06-2014, 03:12 AM
  3. 2010 macro not working in 2013 via button
    By PaulieNZ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-01-2013, 01:27 PM
  4. 2010 macro runs slowly in 2013
    By PaulieNZ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-24-2013, 09:00 PM
  5. Windows 8, Excel 2013 and Project 2010 - Reference Error in Macro
    By microsoftexcel007 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-01-2013, 06:23 PM

Tags for this Thread

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