+ Reply to Thread
Results 1 to 4 of 4

VBA/Macro to copy a set of rows based on a cell criteria and paste it in new location

  1. #1
    Registered User
    Join Date
    08-01-2013
    Location
    SFO
    MS-Off Ver
    Excel 2003
    Posts
    2

    VBA/Macro to copy a set of rows based on a cell criteria and paste it in new location

    Hi Experts,

    Need your expertise help in solving this. Bit badly needed.

    I would like to copy the contents of rows (O,P,Q,R) based on cell criteria N and Paste it in the next available blank rows of (A,B,C and D)
    Please help me in solving this.

    VBA/Macro to copy a set of rows(O,P,Q,R) based on Cell criteria N and Paste it in next available rows (A,B,C,D)

    Attached is the excel file for your reference. As you can see Column N has texts "New". Whenver the column N finds "New" the contents of Column O,P,Q and R to be copied to next blank area in Column A,B,C and D.

    Need your help as i am a novice in VB/Macro

    Thanks in Advance.
    Nids
    Attached Files Attached Files

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA/Macro to copy a set of rows based on a cell criteria and paste it in new location

    Hi,

    One way with the following macro

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    08-01-2013
    Location
    SFO
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: VBA/Macro to copy a set of rows based on a cell criteria and paste it in new location

    Hi Richard,

    Works perfectly. Thankyou. There is a small hitch though. Is it possible to paste only once.
    Right now as and when i run more than once, the duplicates are created in column A. I would like to avoid duplicates.

    Need your hlep in avoiding creating duplicates eventhough when the macro is run multiple times.

    Thanks in Advance.

    Regards,
    Nids

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: VBA/Macro to copy a set of rows based on a cell criteria and paste it in new location

    Hi,

    You could add a final line

    Range("N:N").Replace what:="New", replacement:="Already Exists"

    will that do?

+ 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. [SOLVED] Macro to copy rows (in a range) based on a cell criteria
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-23-2013, 07:54 PM
  2. [SOLVED] Macro to Copy Data and Paste Values Based on cell criteria
    By Taislin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-16-2012, 06:51 PM
  3. Replies: 1
    Last Post: 10-28-2012, 01:13 AM
  4. Copy and Paste to location based on cell value
    By CBron12 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-15-2010, 03:02 PM
  5. [SOLVED] Macro to copy and paste rows to a new sheet based on criteria
    By Belo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-31-2010, 02:25 AM

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