+ Reply to Thread
Results 1 to 6 of 6

Subscript out of range when addressing worksheet

  1. #1
    Registered User
    Join Date
    05-24-2012
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    9

    Subscript out of range when addressing worksheet

    Why does this fail with a subscript out of range error? The worksheet "January" exists.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Subscript out of range when addressing worksheet

    I do not see any error with the line, and the error might be somewhere else in the code

  3. #3
    Registered User
    Join Date
    05-24-2012
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Subscript out of range when addressing worksheet

    I can take out all of the other code to leave just the following, and still get the error.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Subscript out of range when addressing worksheet

    There may be a space on Worksheets("January") name
    Copy the sheet name from excel and paste it in to the code(Not manually)

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Subscript out of range when addressing worksheet

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-24-2012
    Location
    Scotland
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Subscript out of range when addressing worksheet

    Yup - January had a trailing space.

+ 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