run-tim error 9: Subscription out of range error

  • Hello, Can someone please help?
    I am a little frustrated because this code did work just fine before I copied the code to another spreadsheet. The new spreadsheet still has the same number of tabs and tab names so I am not sure why it is not working.


    I am trying to copy contents from multiple spreadsheets into one main spreadsheet. I CAN copy from the first tab of multiple spreadsheets into the main one. That works fine (sub Overdraft_MECH). But when I run sub Overdraft_NCCS, that's when I get the out of range error message. Can someone please help?
    Out of error essage happens in sub O_2.


    Thanks.


  • Re: run-tim error 9: Subscription out of range error


    Please edit your post to include code tags around the code listings.


    Code tags are are required by the rules here as they format and colourise the code making it easier to read and so follow the logic.


    Tags are added by editing your post (click the 'Edit post' link below the message), highlighting each seperate code block and clicking the # button on the edit window toolbox.


    You will have to remove the colour formatting, though.

  • Re: run-tim error 9: Subscription out of range error


    Try:


    Code
    With .Sheets("2) Overdraft - NCCS (R925) ").Range("B" & st_row & ":M" & st_row).Copy

    instead of what you have there.

  • Re: run-tim error 9: Subscription out of range error


    Does the worksheet name really have that extra space at the end? I saw that, but figured it probably wasn't something like that. You might consider using the code name instead of the "string" name.

  • Re: run-tim error 9: Subscription out of range error


    I noticed that too so I tried without the space but it didn't make any difference.

  • Re: run-tim error 9: Subscription out of range error


    Ok...next step is posting your workbook on here as an attachment. Then we can get the total picture of what's going on.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!