+ Reply to Thread
Results 1 to 8 of 8

Paste to a Dynamic range

  1. #1
    Registered User
    Join Date
    02-04-2011
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Paste to a Dynamic range

    I want to copy a particular row (one that meets the "IF" criteria) from one workbook and paste it to a particular tab of another workbook. In the another workbook, where I intend to paste the copied row, I want to do it over a dynamic range,wherein I can vary the row number after completion of every "IF" loop.

    To do this I wanted to specify the cell locations in the range where the copied stuff is to be pasted.Here I want to keep incrementing the row by one unit every loop but want to keep the column number fixed.

    I am pasting the code below:

    Please Login or Register  to view this content.
    Last edited by abhitullu; 02-07-2011 at 08:27 AM. Reason: add code tags for newbie

  2. #2
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Pasting to a Dynamic range

    Hi abhitullu

    with the "Cardine5H.xlsx" open

    Please Login or Register  to view this content.
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  3. #3
    Registered User
    Join Date
    02-04-2011
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Pasting to a Dynamic range

    Thanks.

    The code pastes the selected stuff to the Cardine5H.xlsx sheet's specified worksheet but starts from the very first row.
    If I want to specify the row, from where it should start pasting the stuff, what should I do?

  4. #4
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Pasting to a Dynamic range

    Hi abhitullu
    for start in row 20

    untested but try...
    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    or put a 1 in cell a19

  5. #5
    Registered User
    Join Date
    02-04-2011
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Paste to a Dynamic range

    not working.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    Re: Paste to a Dynamic range

    try..
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-04-2011
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Paste to a Dynamic range

    The first code where you had used offset worked fine if I run the macro only once.

    But if i update my master sheet from where I am copying stuff and then re-run the macro, the code starts pasting (Cardine5H.xlsx sheet) to the first row which is empty and not the very first row (as was the case in the first run).so, what should I do? I want that no matter what whenever I run the macro it should start pasting from the specified row (here the first row) and go downwards.

  8. #8
    Registered User
    Join Date
    02-04-2011
    Location
    Mumbai
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Paste to a Dynamic range

    Thanks.Everything is working fine now.

+ 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