+ Reply to Thread
Results 1 to 2 of 2

Subscript out of range error

  1. #1
    Registered User
    Join Date
    11-25-2008
    Location
    London
    Posts
    5

    Subscript out of range error

    H All,

    I am trying to transfer data from 'Week 34.xls' to 'DM Tracker.xls' based on matching Telephone numbers in Col B of 'Week 34.xls' and Col B of 'DM Tracker.xls',but I receive a 'Runtime error 9 : Subscript Out of Range' error for the following data transfer code at line 3. Can anyone guide me with this?

    Sub pulldata()
    x = Workbooks("DM Tracker.xls").Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row
    y = Workbooks("Week 34.xls").Worksheets("Overall").Cells(Rows.Count, 1).End(xlUp).Row
    For a = 3 To x
    Workbooks("DM Tracker.xls").Worksheets("sheet2").Cells(1, 26) = "=match(B" & a & "[Week 34.xls]overall!B2:B" & y & ",0)"
    b = Workbooks("DM Tracker.xls").Worksheets("sheet2").Cells(1, 26)
    Workbooks("DM Tracker.xls").Worksheets("sheet2").Cells(a, 3) = Workbooks("Week 34.xls").Worksheets("overall").Cells(b, 5)
    Workbooks("DM Tracker.xls").Worksheets("sheet2").Cells(a, 4) = Workbooks("Week 34.xls").Worksheets("overall").Cells(b, 29)
    Next a
    MsgBox "collecting data complete"
    End Sub

    Thanks,
    Matt
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    05-21-2004
    Location
    UK
    Posts
    136
    Assuming those workbooks and thoise sheets exist, try

    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