+ Reply to Thread
Results 1 to 3 of 3

Code to work in both Excel 2013 and 2003

  1. #1
    Forum Contributor
    Join Date
    11-14-2007
    Posts
    142

    Code to work in both Excel 2013 and 2003

    Hi, I have a small section of code in a workbook originally designed for use in Excel 2003
    The purpose is to hide all rows, from one containing a defined cell named "EndRowMarker", down to the last row in the worksheet.

    Please Login or Register  to view this content.
    I have adapted the code so that it works in Excel 2013:
    Please Login or Register  to view this content.
    What I would rather do is have some non-version-specific code so that the same workbook would work in either environment.
    I suppose that I could achieve this by first trying row 1048576 but with an error trapping line so that if this returns an error state to ignore and reset the error state and then re-do the exercise restricting it to row 65536.
    That seems a little inelegant, and I have a vague recollection that Excel recognises some "special cells", which might include the last row of the worksheet. Would this be available and, crucially, identically defined between versions 2003 and 2013?

    Any suggestions gratefully received.

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Code to work in both Excel 2013 and 2003

    You may use Rows.Count:
    Please Login or Register  to view this content.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Forum Contributor
    Join Date
    11-14-2007
    Posts
    142

    Re: Code to work in both Excel 2013 and 2003

    That's great. Thanks.
    (Can't seem to flag the post as solved. Go Advanced button not working at present - may revisit later of different machine)

+ 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. Code created in Excel 2010 does not work with Excel 2013
    By Steve@Rugby in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2014, 10:14 AM
  2. [SOLVED] Help needed to make 2013 VBA code work on 2007
    By craigten in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-17-2013, 02:02 AM
  3. Code won't work in Excel 2003, but will in 2007/2010
    By Mak2145 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 03-30-2012, 12:23 PM
  4. VBA Code works in Excel 2003 but won't work in Excel 2000
    By aglazer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-05-2005, 10:52 AM
  5. Replies: 0
    Last Post: 09-05-2005, 05:05 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