+ Reply to Thread
Results 1 to 3 of 3

Worksheet_Change - Subscript Out Of Range

  1. #1
    Forum Contributor
    Join Date
    02-25-2010
    Location
    Birmingham, England
    MS-Off Ver
    Excel 2010
    Posts
    138

    Worksheet_Change - Subscript Out Of Range

    Afternoon All,

    I am looking for some assistance.... Every time this portion of the code below runs, it throws up a Subscript out of range error.

    The Workbook Name is correct, The Sheet nems are correct and the PivotTable names are correct...

    Can anybody see anything I am missing?

    PHP Code: 
    Private Sub Worksheet_Change(ByVal Target As Range)

        
    Workbooks("IO - LIVE").Worksheets("PIVOT").PivotTables("PivotInvoice").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("PIVOT").PivotTables("PivotInput").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("PIVOT").PivotTables("PivotCredit").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("PIVOT").PivotTables("PivotOutA").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("PIVOT").PivotTables("PivotOutM").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("PIVOT").PivotTables("PivotOutC").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("PIVOT").PivotTables("PivotDel").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("PIVOT").PivotTables("PivotInv").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("PIVOT").PivotTables("PivotComV").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("Stats").PivotTables("StatOutVWk").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("Stats").PivotTables("StatDel").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("Stats").PivotTables("StatOrdBk").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("Stats").PivotTables("StatArchDay").PivotCache.Refresh
        Workbooks
    ("IO - LIVE").Worksheets("Stats").PivotTables("StatMouldDay").PivotCache.Refresh

    End Sub 
    Many Thanks
    Ross

  2. #2
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,979

    Re: Worksheet_Change - Subscript Out Of Range

    Include the file extension in the workbook name. Or, if it's the same workbook that the code is in, use ThisWorkbook instead.
    Everyone who confuses correlation and causation ends up dead.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,189

    Re: Worksheet_Change - Subscript Out Of Range

    They're all separate instructions. So, which one is highlighted? Which worksheet module has the code in it?

    You do realise that every time you make ANY change to the worksheet, it will refresh all the Pivot Tables?


    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ 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. Subscript out of range
    By Biplab1985 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 06-08-2016, 04:21 PM
  2. Replies: 1
    Last Post: 06-15-2015, 01:56 AM
  3. [SOLVED] Getting Subscript Out of Range
    By bbmak in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2014, 08:08 PM
  4. Subscript Out of Range
    By blyzzard in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-06-2013, 05:25 PM
  5. Define range to select from current cell in a full range (using worksheet_change)
    By draddy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-07-2013, 11:48 AM
  6. Subscript out of range error while populating array from range.
    By Aussiexile in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-04-2010, 02:22 AM
  7. Subscript out of range error when trying to select a range
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2010, 07:57 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