Results 1 to 27 of 27

Comapring two excel worksheets and adding or deleting rows as needed

Threaded View

  1. #1
    Registered User
    Join Date
    12-27-2011
    Location
    Bham, AL
    MS-Off Ver
    Excel 2007
    Posts
    14

    Smile Comapring two excel worksheets and adding or deleting rows as needed

    Good Afternoon,

    I am new to VBA coding and need help with excel VBA.

    I have one work book with two worksheets, one is a current worksheet (S1) the other is an update version of the first(S2). All columns are the same and each will contain approximately 20,000 rows of data in.

    1. I want to compare each cell in column A of S2 to all of column A in S1
    a. If cell from S2 is equal to any cell in column A of S1 then do nothing
    b. If cell from S2 is not equal to any cell in column A of S1 then add the corresponding row data to S1

    2. Compare each cell in cloumn A of S1 to each cell in column A of S2
    a. If cell from S1 is equal to any cell in column A of S2 then do nothing
    b. If cell from column A of S1 is not equal to any cell in column A of S2 then do:
    1. Create new worksheet (S3) and add corresponding row of data to new row in S3
    2. Delete corresponding row of data from S1

    If you need a sample of the workbook I can sanitize and supply, but preferable on to give out.
    Last edited by dmreno; 12-28-2011 at 09:34 AM. Reason: code provided worked perfectly!

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