+ Reply to Thread
Results 1 to 3 of 3

Copy row contaning matching value to another workbook - Subscript out of range error

  1. #1
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Copy row contaning matching value to another workbook - Subscript out of range error

    Hey again,
    I'm having a little trouble sending a row to another workbook, was wondering if someone could offer a little advice as to what I'm doing wrong? I have 3 workbooks, A,B, and C. Workbook A contains my code. The code needs to open workbook B and find a value in column BF. If that value is found, it is then to search a directory for a workbook with today's date...this is workbook C. If workbook C exists, I need to open it and copy the row that had the matching value from workbook B to the first blank row in workbook C.

    I think I have the searching/opening/matching part down. I'm running into a 'Subscript out of range' error when trying to set the values of the first blank row in workbook C equal to the values of the row from workbook B. Here is my code in full
    Please Login or Register  to view this content.
    I'm getting the error on this line
    Please Login or Register  to view this content.
    Any thoughts on what I'm doing wrong? If you have a different method to suggest I'm all ears as well

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

    Re: Copy row contaning matching value to another workbook - Subscript out of range error

    You have not specified the sheet name. You have said "Activeworkbook.Cells" but you are missing the sheet name there.
    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
    Forum Contributor
    Join Date
    07-26-2012
    Location
    USA
    MS-Off Ver
    Excel 2007 & 2010
    Posts
    351

    Re: Copy row contaning matching value to another workbook - Subscript out of range error

    Go it sorted, thanks

+ 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