+ Reply to Thread
Results 1 to 6 of 6

Search for criteria in a column, cut and paste row to next empty row in new sheet

  1. #1
    Registered User
    Join Date
    11-15-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    41

    Search for criteria in a column, cut and paste row to next empty row in new sheet

    Hi all!

    I have 2 worksheets, one called "Consolidated" and one called "Converted".

    I have a spreadsheet where I press the update button and a macro runs that searches for the word "Converted" in column E on the Consolidated spreadsheet (the original). When it finds it, the entire row will be cut and pasted onto the "Converted" worksheet.

    I have managed (with some help!) to do this with my current code. However when you press the update button again, all the newly pasted rows on the Converted worksheet are deleted. (I would like when i press the update button it to NOT affect the Converted worksheet, just add any new data found on the Consolidated sheet to the Converted sheet.) I assume this is because my current code her below is NOT telling the spreadsheet to paste to the NEXT AVAILABLE EMPTY ROW. Please see my current code:

    Please Login or Register  to view this content.
    So the problem is this line:
    Please Login or Register  to view this content.
    I have attempted to replace this line with:
    Please Login or Register  to view this content.
    But there is something wrong as the code keeps breaking on that line!

    Any help would be greatly appreciated. Thanks!

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Search for criteria in a column, cut and paste row to next empty row in new sheet

    Cath,
    This line is correct. It may be that column A is empty, so that the code keeps pasting the data on the next empty row . The code you have is not greate, but to write you a new code, I need to see the sample
    Please Login or Register  to view this content.
    Last edited by AB33; 07-25-2014 at 07:41 AM.

  3. #3
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Search for criteria in a column, cut and paste row to next empty row in new sheet

    Can you provide a sample which does that? At first site the code looks good to me.

  4. #4
    Registered User
    Join Date
    11-15-2013
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: Search for criteria in a column, cut and paste row to next empty row in new sheet

    Hi - here is a sample and the entire code for the sample. I took out part of the code out (it didn't have anything to do with the question that I originally asked) or so i thought, as it seemed to be working okay...

    Here is the entire code for the sample:
    Please Login or Register  to view this content.
    And the attached workbook too...

    Thanks!
    Attached Files Attached Files

  5. #5
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Search for criteria in a column, cut and paste row to next empty row in new sheet

    So, what is the issue then?

  6. #6
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Search for criteria in a column, cut and paste row to next empty row in new sheet

    You need to change this line

    Please Login or Register  to view this content.
    This implies the code will look at any sheet
    INTO

    Please Login or Register  to view this content.
    Then 'This implies the code will look at Set w1 = Sheets("Consolidation")

+ 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. Replies: 1
    Last Post: 05-21-2014, 05:05 AM
  2. Search row with criteria in all sheet, copy rows and paste in new created sheet
    By dekueb in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-24-2013, 01:42 PM
  3. Search a column for a certain criteria and cut and paste in new sheet.
    By awagenhurst in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-19-2012, 02:23 PM
  4. [SOLVED] Search multiple sheets for criteria and paste all matched rows in new sheet
    By BertLady56 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-14-2012, 01:09 PM
  5. Search all worksheets and paste all rows w/search criteria to single sheet
    By hutch@edge.net in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-22-2012, 01:31 PM

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