+ Reply to Thread
Results 1 to 4 of 4

Run Time Error 9

  1. #1
    Registered User
    Join Date
    01-25-2010
    Location
    West Midlands, England
    MS-Off Ver
    Excel 2007
    Posts
    14

    Run Time Error 9

    Hi All

    I'm pretty new to VBA and have run into a stubbon error when working on a textbook example.

    The sample code is supposed to write settings from an add-in to the User Interface Worksheets.

    The error is 'Run Time Error 9, Subscript Out of Range'

    Any help with this would be greatly appreciated.

    (Excel 2007 & XP Pro)

    Mark


    The code is:


    Please Login or Register  to view this content.
    Last edited by Leith Ross; 11-20-2011 at 02:14 PM. Reason: Changed HTML Tags to Code Tags

  2. #2
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: Run Time Error 9

    On which line does it give you the error. When you are running the code and it encounters an error, the line will be in highlighted in yellow.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    01-25-2010
    Location
    West Midlands, England
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: Run Time Error 9

    Hi Arlette

    just after the first For statement:

    Set wksSheet = wkbTemplate.Worksheets(sSheetTab)

    thanks,

    mark

  4. #4
    Registered User
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,164

    Re: Run Time Error 9

    It will be better if you attach the workbook which contains this code so we can debug it.

+ 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