+ Reply to Thread
Results 1 to 2 of 2

runtime error 9 - subscript out of range

  1. #1
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    runtime error 9 - subscript out of range

    hi guys. Please see attached demo workbook showing my issue.

    I am trying to run the macro Loopthroughsheets, which should copy all images which appear in the workbook and paste them into sheet 1. The debugger points to this line

    Sheets("Map () " & n).Pictures(1).Copy

    Sub LoopThroughSheets()
    Dim n As Long
    For n = 2 To 8
    Sheets("Map () " & n).Pictures(1).Copy
    Workbooks("Maps FINAL For Forum").Sheets("Sheet1").Range("A" & n * 10).PasteSpecial
    Next n
    End Sub

    Could someone please take a look.

    thansk
    Attached Files Attached Files
    Last edited by Blake 7; 10-10-2012 at 12:16 PM.
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  2. #2
    Forum Contributor
    Join Date
    03-15-2007
    Location
    AL, USA
    MS-Off Ver
    2007
    Posts
    174

    Re: runtime error 9 - subscript out of range

    In your code, you look for a sheet called "Maps () " & n. This sheet does not exist because none of your sheet names contain "()"

    Try this code:
    Please Login or Register  to view this content.

+ 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