Results 1 to 14 of 14

compare data and move it to new sheet

Threaded View

  1. #2
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: compare data and move it to new sheet

    Try the following code...

    sub MoveDup()
    set x=range("B2:B18")
    for each sheet in sheets(array("Sheet1","Sheet2")
    for each cell in x
    for each cell1 in x
    if cell=cell1 then
    cell.entirerow.select
    selection.cut
    Sheets("Sheet3").activate
    Range("A1").offset(r,0).select
    application.paste
    r=r+1
    cell1.entirerow.select
    selection.cut
    Sheets("Sheet3").activate
    Range("A1").offset(r,0).select
    application.paste
    r=r+1
    end if
    next
    next
    next
    End sub
    Before running this code.. make a new worksheet "sheet3"


    Don't forget, click *
    Last edited by Vikas_Gautam; 07-19-2014 at 12:13 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Compare 2 sheets and move unmatched to sheet 3
    By JAYRUES in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2012, 07:07 AM
  2. Compare columns in worksheets and move to correct sheet.
    By CRIMEDOG in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-29-2011, 12:25 PM
  3. Loop through cells compare values add and move to another sheet
    By begilhang in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2010, 04:07 AM
  4. How to identify text (compare) in one sheet, then move it another
    By mag7417 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-14-2005, 10:54 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