+ Reply to Thread
Results 1 to 3 of 3

Copy a range based on dynamic row numbers and paste into another workbook

  1. #1
    Registered User
    Join Date
    06-18-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2013/2016
    Posts
    40

    Copy a range based on dynamic row numbers and paste into another workbook

    Hi,

    I'm looking to copy a range of 22 rows from columns A through to AZ on a different closed workbook and bring them into the active workbook and I'd like to be able to do it in VBA if possible. The closed workbook has at the moment about 10,000 rows. On the active workbook in cell B4 I have a data validation drop-down where the week number can be selected and then in D4 and E4 I have a couple of Vlookups that find the row numbers that need to be copied for the particular week number in B4. In my example file you can see an example of how I want to import the 22 rows. If I select a different week I would like the data over written in the same place.

    I'd be very grateful for any help on this, I've managed to get the data in using Index Match formulas but because the files are located on a server to which the file paths are quite long the formulas look very messy. I enjoy working on formulas but my VBA is no where near the same level unfortunately.

    Thanks in advance..
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor tehneXus's Avatar
    Join Date
    04-12-2013
    Location
    Hamburg, Germany
    MS-Off Ver
    Work: MS-Office 2010 32bit @ Win8 32bit / Home: MS-Office 2016 32bit @ Win10 64bit
    Posts
    944

    Re: Copy a range based on dynamic row numbers and paste into another workbook

    Hi,

    try the files attached: support.zip

    You'll have to adapt the file/sheet name and path of the sourcefile, if not open the macro will open the file and close it afterwards.

    File contains in the worksheet module:
    Please Login or Register  to view this content.
    and in a standard module
    Please Login or Register  to view this content.
    Please use [CODE]-TAGS
    When your problem is solved mark the thread SOLVED
    If an answer has helped you please click to give reputation
    Read the FORUM RULES

  3. #3
    Registered User
    Join Date
    06-18-2009
    Location
    Northampton, England
    MS-Off Ver
    Excel 2013/2016
    Posts
    40

    Re: Copy a range based on dynamic row numbers and paste into another workbook

    Hi tehneXus,

    Thanks very much for taking the time to help me out, it works perfectly...you're a star !

    Grizz.

+ 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