+ Reply to Thread
Results 1 to 7 of 7

Macro copies row based on a cell data but leaves blank rows between them.

  1. #1
    Registered User
    Join Date
    11-16-2017
    Location
    knoxville tn
    MS-Off Ver
    2016
    Posts
    13

    Macro copies row based on a cell data but leaves blank rows between them.

    Hey all, I have an Excel Sheet that I need to copy the row to another sheet if one of the cells contains specific text. I have found one that does just that, however, it copies it to the same row that it is on the other sheet, leaving me with blank rows between them. I would like them to paste into the next blank row starting with row 2 (row 1 will have headers in it that match the headers in sheet 1 where it is pulling the data from). I have put below the macro that I am currently running and have attached a copy of the workbook with that macro for reference.

    If row F cells contain "D1", the entire row will copy and paste to the next blank row on sheet 3 (named D1)


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by JesterGrafix; 09-01-2018 at 04:26 PM.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Macro copies row based on a cell data but leaves blank rows between them.

    Hallo ...

    In future please view the forum rules before posting. Your post does not comply with rule #3.
    3. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing.
    So, do the following:
    Edit your post, highlight your code and click the [#] button at the top of the post window.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Macro copies row based on a cell data but leaves blank rows between them.

    Thanx JesterGrafix ...
    Help you now we can ...
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-16-2017
    Location
    knoxville tn
    MS-Off Ver
    2016
    Posts
    13

    Re: Macro copies row based on a cell data but leaves blank rows between them.

    Quote Originally Posted by sintek View Post
    Thanx JesterGrafix ...
    Help you now we can ...
    Please Login or Register  to view this content.
    Thanks so much for the help! This did exactly what I needed. Now to do some research on how to have multiple macros doing basically the same thing but using a different search criteria and going to a different sheet. Thanks so much!!!

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Macro copies row based on a cell data but leaves blank rows between them.

    No need to quote entire posts ... Only you and I here at the moment ...
    Assuming your sheets are already created...
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-16-2017
    Location
    knoxville tn
    MS-Off Ver
    2016
    Posts
    13

    Re: Macro copies row based on a cell data but leaves blank rows between them.

    Thank you so very much, you have helped me out more than i can say and many people will be very happy that this is now working. You are awesome!!

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: Macro copies row based on a cell data but leaves blank rows between them.

    ...........................................
    Thanks.gif
    ....Pls Mark Thread As Solved....

+ 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. VBA code that finds data based on criteria, moves up two rows, copies cell to new sheet
    By Excelsior12 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-31-2016, 05:47 PM
  2. Macro that copies & paste-special(Values) non-blank rows
    By Elieson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2015, 12:27 PM
  3. Macro copies rows based on condition, BUT rows copy in Wrong order. PLEASE HELP!
    By JAllard1990 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-16-2014, 04:33 PM
  4. [SOLVED] Wirte macro that copies data from 1 cell to a different cell based on data in a third cell
    By Geoff Jones in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-11-2013, 12:37 PM
  5. [SOLVED] 1 or blank cell pulls exact text or leaves cell blank
    By sharpmel in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-30-2012, 12:20 PM
  6. [SOLVED] If statement that copies text from a separate worksheet, or if blank, leaves cell blank.
    By barleycorn in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-22-2012, 12:30 PM
  7. [SOLVED] Hiding Rows Leaves Labels Blank
    By Laura in forum Excel General
    Replies: 3
    Last Post: 03-24-2006, 09:15 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