Results 1 to 6 of 6

runtime error 9 subscript out of range help

Threaded View

  1. #1
    Forum Contributor
    Join Date
    11-08-2011
    Location
    Leeds
    MS-Off Ver
    Excel 2010
    Posts
    279

    runtime error 9 subscript out of range help

    Hi,

    I have created the below code, which when I last used it was working fine. but it now has a runtime error 9 and I'm not sure why this is. I have highlighted the part of the code with this runtime error.

    I'm not sure if its down to this but the file we are opening gets saved over everynight with the updated figures.

    I dont know if this will make a difference but in the code below I have changed the file path location to just "file path" and the excel document its opening from that path to "KPI.xlsx" these arent the correct names but due to certain reason I cant upload the actual file path and name.

    Sub theone()
    '
    ' theone Macro
    '

    '
    Sheets("Instructions download").Select
    Range("A8").Select
    Range("A8:T60000").Select
    Selection.ClearContents
    Range("A8").Select
    Sheets("Aborted download").Select
    Range("A8:O60000").Select
    Selection.ClearContents
    Range("A8").Select
    Sheets("Completions download").Select
    Range("A8").Select
    Range("A8:V60000").Select
    Selection.ClearContents
    Range("A8").Select
    Windows("Volumes.xlsx").Activate
    Workbooks.Open Filename:= _
    "Fil"
    Sheets("Completions").Select
    Range("E12").Select
    Selection.AutoFilter
    Range("D12").Select
    ActiveSheet.Range("A6:V60000").AutoFilter Field:=6, Criteria1:= _
    xlFilterThisMonth, Operator:=xlFilterDynamic
    Range("A8").Select
    Range("A8:V60000").Select
    Selection.Copy
    Windows("Volumes.xlsx").Activate
    Range("A8").Select
    ActiveSheet.Paste
    Sheets("Aborted download").Select
    Windows("KPIs.xls").Activate
    Sheets("Aborted").Select
    Range("D14").Select
    Application.CutCopyMode = False
    Selection.AutoFilter
    ActiveSheet.Range("A6:O60000").AutoFilter Field:=7, Criteria1:= _
    xlFilterThisMonth, Operator:=xlFilterDynamic
    Range("A18").Select
    Range("A8:O60000").Select
    Selection.Copy
    Windows("Volumes.xlsx").Activate
    ActiveSheet.Paste
    Range("A8").Select
    Sheets("Instructions download").Select
    Windows("KPIs.xls").Activate
    Sheets("Completions").Select
    Windows("KPIs.xls").Activate
    Sheets("Instructions").Select
    Range("D17").Select
    Application.CutCopyMode = False
    Selection.AutoFilter
    Range("C17").Select
    ActiveSheet.Range("A6:T60000").AutoFilter Field:=4, Criteria1:= _
    xlFilterThisMonth, Operator:=xlFilterDynamic
    Range("A265").Select
    Range("A8:T60000").Select
    Selection.Copy
    Windows("Volumes.xlsx").Activate
    ActiveSheet.Paste
    Range("A8").Select
    Application.CutCopyMode = False
    Calculate
    ChDir _
    "File Path "
    ChDir _
    "File Path"
    ActiveWorkbook.SaveAs Filename:="File Path" & Format(Now(), "DD-MM-YYYY")
    End Sub

    Last edited by skate1991; 11-24-2014 at 06:03 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Runtime Error 9 - Subscript out of range
    By Swalih in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2014, 01:52 AM
  2. Runtime error 9: Subscript out of range
    By davidmurphy25 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-19-2013, 09:40 PM
  3. [SOLVED] Runtime error 9: subscript out of range..
    By daveyc18 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-19-2013, 03:02 PM
  4. Runtime error '9' Subscript out of range
    By mickinho in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-03-2013, 03:00 AM
  5. [SOLVED] runtime error 9 - subscript out of range
    By Blake 7 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-10-2012, 12:20 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