+ Reply to Thread
Results 1 to 3 of 3

Problem with VBA code written in 2007 and run in 2010

  1. #1
    Registered User
    Join Date
    07-16-2012
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2007
    Posts
    2

    Problem with VBA code written in 2007 and run in 2010

    My office is in the middle of upgrading from office 2007 to 2010. I have not noticed any problems with any of my files except for this one. From what I've researched and talked with people it seems that my code is not complex enough (nor am I very advanced) to have my code effected by the upgrade from VBA6 to VBA7. I am still on 2007, but have access to a virtual version of 2010 .

    I have this report that calculates amount of spend for each project that I (and others) run often from a sample of data we pull out of a larger database. Other code sets up the report and pulls out the data for each project to create a sheet for each project with a summary of spend and total spend. Everything works correctly in 2010 except for the calculation part (the very last part) of this macro where the totals (based on the conditions) are placed in B4, B5 and B6. When I run it in 2010, B4, B5 and B6 all have the equation that B6 should have. It seems like the equations are copied over in the cells because when i run it without B6, the equation in B5 is in the cells B4, B5, B6. I run this macro again for the cells C4, C5, C6 and the same thing happens except the equation for C6 is in C4, C5 and C6. I have tried using relative references and that made no difference.

    Please Login or Register  to view this content.
    I'd really appreciate any help!
    Last edited by kmichae; 07-18-2012 at 08:18 AM.

  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,259

    Re: Problem with VBA code written in 2007 and run in 2010

    Hello kmichae,

    Welcome to the Forum!

    The only obvious problem I see is you don't have a line label in your code for "SU". If POcnt is zero this will error.
    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!)

  3. #3
    Registered User
    Join Date
    07-16-2012
    Location
    Ann Arbor, MI
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Problem with VBA code written in 2007 and run in 2010

    Figured it out- Problem was with Excel's 2010 auto correction settings that sets all equations in a table column the same. Thanks 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)

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