+ Reply to Thread
Results 1 to 3 of 3

Subscript Error in previously working code.

  1. #1
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Subscript Error in previously working code.

    Help please. My workgroup just recently upgraded to Windows 7 from XP. After doing so and reinstalling Office 2010 I have been having various issues with my tech form project. It had been working flawlessly until the upgrade.

    The issue I need to get resolved in a hurry is this subscript out of range.

    Please Login or Register  to view this content.
    It keeps flagging on this line:

    Lr = lastrow(Workbooks("Monthly Log Sheet.xlsx").Sheets("Sheet 1")) + 1

    I have not changed anything from my previous version and the file locations have not changed. Anyone have any ideas?
    I have been into the Trust Center to allow macros and active X.

    Patrick

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Subscript Error in previously working code.

    Patrick

    Does the workbook 'Monthly Log Sheet.xlsx' have a sheet called 'Sheet 1', with the space?

    Also, have you tried Workbooks("Monthly Log Sheet")?

    PS What's lastrow? A function? An array?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    05-12-2009
    Location
    Hendersonville, TN
    MS-Off Ver
    Excel 2010
    Posts
    113

    Re: Subscript Error in previously working code.

    Thank you for the fast reply Norie. To answer the question, yes Lastrow is a function. After looking into the sheet names a bit more closely, the space in the name was the issue. Pesky little spaces . I have since corrected that and it appears to be working now. Thank you so much for this and the other bits of help you have given over the last year or so. Always good stuff from you.

    Patrick

+ 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] trying to understand why a code is not working "error 9 subscript out off range"
    By cdafonseca in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-09-2013, 12:33 PM
  2. Pivot Table code that has previously worked now returns an error
    By brgr4u in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-22-2013, 02:24 PM
  3. Subscript out of range error & code not working
    By HP RodNuclear in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 07-01-2011, 03:53 PM
  4. Subscript out of range error using all possible combinations code
    By alisalamiii in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-05-2010, 09:57 AM
  5. Unusual error-handling results in previously working code written for Excel 2002
    By guindi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-23-2007, 02:27 PM

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