Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Compare two excel spread sheet with macro

I have one excel spreed that has sheet1 and sheet2, both has same like this
ColumnA ColumnB ColumnC ColumnC
name SSN domain users

sheet1 has 947 records
sheet2 has 1142 records
I would like match SSN on columnB,
if they are match then move all the name, SSN, domain, users to sheet3.
if they are not match then write all the name, SSN, domain, users to sheet4

thanks for all the help

Lillian

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Compare two excel spread sheet with macro

You can use something like this:
Sheet3 (A2):
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),"",INDEX(Sh eet2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet1!$B$2:$B$ 1142,0),COLUMN()))

Sheet4 (A2):
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),INDEX(Sheet 2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet2!$B$2:$B$114 2,0),COLUMN()),"")

Copy to other cells

--

Rodrigo Ferreira
Regards from Brazil


"Lillian Lian" escreveu na mensagem
...
I have one excel spreed that has sheet1 and sheet2, both has same like this
ColumnA ColumnB ColumnC ColumnC
name SSN domain users

sheet1 has 947 records
sheet2 has 1142 records
I would like match SSN on columnB,
if they are match then move all the name, SSN, domain, users to sheet3.
if they are not match then write all the name, SSN, domain, users to
sheet4

thanks for all the help

Lillian



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Compare two excel spread sheet with macro

Rodrigo,

I don't quite understand how to do this? can you explain more detail step
by step?

Thank you for all the help

Lillian



"Rodrigo Ferreira" wrote:

You can use something like this:
Sheet3 (A2):
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),"",INDEX(Sh eet2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet1!$B$2:$B$ 1142,0),COLUMN()))

Sheet4 (A2):
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),INDEX(Sheet 2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet2!$B$2:$B$114 2,0),COLUMN()),"")

Copy to other cells

--

Rodrigo Ferreira
Regards from Brazil


"Lillian Lian" escreveu na mensagem
...
I have one excel spreed that has sheet1 and sheet2, both has same like this
ColumnA ColumnB ColumnC ColumnC
name SSN domain users

sheet1 has 947 records
sheet2 has 1142 records
I would like match SSN on columnB,
if they are match then move all the name, SSN, domain, users to sheet3.
if they are not match then write all the name, SSN, domain, users to
sheet4

thanks for all the help

Lillian




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Compare two excel spread sheet with macro

Lilian,
I'll try to explain:

You have sheet1 with 947 records (the name of this sheet is "Sheet1")
You have sheet2 with 1142 records (the name of this sheet is "Sheet2")
The names have to be Sheet1 and Sheet2 or you will have to change the
formulas.


Insert 2 new Sheets:
The first will have the rows that MATCH and the other NOT MATCH

In the first new sheet, on cell A2 paste this formula:
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),"",INDEX(Sh eet2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet1!$B$2:$B$ 1142,0),COLUMN()))

Copy this formula until column D and row 1200



In the second new sheet, on cell A2 paste this formula:
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),INDEX(Sheet 2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet2!$B$2:$B$114 2,0),COLUMN()),"")

Copy this formula until column D and row 1200


--

Rodrigo Ferreira
Regards from Brazil


"Lillian Lian" escreveu na mensagem
...
Rodrigo,

I don't quite understand how to do this? can you explain more detail
step
by step?

Thank you for all the help

Lillian



"Rodrigo Ferreira" wrote:

You can use something like this:
Sheet3 (A2):
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),"",INDEX(Sh eet2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet1!$B$2:$B$ 1142,0),COLUMN()))

Sheet4 (A2):
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),INDEX(Sheet 2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet2!$B$2:$B$114 2,0),COLUMN()),"")

Copy to other cells

--

Rodrigo Ferreira
Regards from Brazil


"Lillian Lian" escreveu na
mensagem
...
I have one excel spreed that has sheet1 and sheet2, both has same like
this
ColumnA ColumnB ColumnC ColumnC
name SSN domain users

sheet1 has 947 records
sheet2 has 1142 records
I would like match SSN on columnB,
if they are match then move all the name, SSN, domain, users to sheet3.
if they are not match then write all the name, SSN, domain, users to
sheet4

thanks for all the help

Lillian






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Compare two excel spread sheet with macro

Rodrigo,

How to copy this formula until column D and row 1200, I hight light the
A2 to D2 and all the way down to 1200 row, and copy and paste, but nothing
happen,
am I doing something wrong?


Lillian

"Rodrigo Ferreira" wrote:

Lilian,
I'll try to explain:

You have sheet1 with 947 records (the name of this sheet is "Sheet1")
You have sheet2 with 1142 records (the name of this sheet is "Sheet2")
The names have to be Sheet1 and Sheet2 or you will have to change the
formulas.


Insert 2 new Sheets:
The first will have the rows that MATCH and the other NOT MATCH

In the first new sheet, on cell A2 paste this formula:
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),"",INDEX(Sh eet2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet1!$B$2:$B$ 1142,0),COLUMN()))

Copy this formula until column D and row 1200



In the second new sheet, on cell A2 paste this formula:
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),INDEX(Sheet 2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet2!$B$2:$B$114 2,0),COLUMN()),"")

Copy this formula until column D and row 1200


--

Rodrigo Ferreira
Regards from Brazil


"Lillian Lian" escreveu na mensagem
...
Rodrigo,

I don't quite understand how to do this? can you explain more detail
step
by step?

Thank you for all the help

Lillian



"Rodrigo Ferreira" wrote:

You can use something like this:
Sheet3 (A2):
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),"",INDEX(Sh eet2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet1!$B$2:$B$ 1142,0),COLUMN()))

Sheet4 (A2):
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),INDEX(Sheet 2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet2!$B$2:$B$114 2,0),COLUMN()),"")

Copy to other cells

--

Rodrigo Ferreira
Regards from Brazil


"Lillian Lian" escreveu na
mensagem
...
I have one excel spreed that has sheet1 and sheet2, both has same like
this
ColumnA ColumnB ColumnC ColumnC
name SSN domain users

sheet1 has 947 records
sheet2 has 1142 records
I would like match SSN on columnB,
if they are match then move all the name, SSN, domain, users to sheet3.
if they are not match then write all the name, SSN, domain, users to
sheet4

thanks for all the help

Lillian









  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 79
Default Compare two excel spread sheet with macro

Copy only A2 and paste to all the others cells (B2, C2, D2, B3, C3, ...,
D1200)


The blank rows in the first new sheet will indicate that that row not match
(this row is in the second sheet)
The blank rows in the second new sheet will indicate that that row match
(this row is in the first sheet)

--

Rodrigo Ferreira
Regards from Brazil



"Lillian Lian" escreveu na mensagem
...
Rodrigo,

How to copy this formula until column D and row 1200, I hight light the
A2 to D2 and all the way down to 1200 row, and copy and paste, but nothing
happen,
am I doing something wrong?


Lillian

"Rodrigo Ferreira" wrote:

Lilian,
I'll try to explain:

You have sheet1 with 947 records (the name of this sheet is "Sheet1")
You have sheet2 with 1142 records (the name of this sheet is "Sheet2")
The names have to be Sheet1 and Sheet2 or you will have to change the
formulas.


Insert 2 new Sheets:
The first will have the rows that MATCH and the other NOT MATCH

In the first new sheet, on cell A2 paste this formula:
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),"",INDEX(Sh eet2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet1!$B$2:$B$ 1142,0),COLUMN()))

Copy this formula until column D and row 1200



In the second new sheet, on cell A2 paste this formula:
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),INDEX(Sheet 2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet2!$B$2:$B$114 2,0),COLUMN()),"")

Copy this formula until column D and row 1200


--

Rodrigo Ferreira
Regards from Brazil


"Lillian Lian" escreveu na
mensagem
...
Rodrigo,

I don't quite understand how to do this? can you explain more detail
step
by step?

Thank you for all the help

Lillian



"Rodrigo Ferreira" wrote:

You can use something like this:
Sheet3 (A2):
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),"",INDEX(Sh eet2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet1!$B$2:$B$ 1142,0),COLUMN()))

Sheet4 (A2):
=IF(ISERROR(INDEX(Sheet2!$A$2:$D$1142,MATCH(Sheet2 !$B2,Sheet1!$B$2:$B$1142,0),COLUMN())),INDEX(Sheet 2!$A$2:$D$1142,MATCH(Sheet2!$B2,Sheet2!$B$2:$B$114 2,0),COLUMN()),"")

Copy to other cells

--

Rodrigo Ferreira
Regards from Brazil


"Lillian Lian" escreveu na
mensagem
...
I have one excel spreed that has sheet1 and sheet2, both has same
like
this
ColumnA ColumnB ColumnC ColumnC
name SSN domain users

sheet1 has 947 records
sheet2 has 1142 records
I would like match SSN on columnB,
if they are match then move all the name, SSN, domain, users to
sheet3.
if they are not match then write all the name, SSN, domain, users to
sheet4

thanks for all the help

Lillian









Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro find and delete duplicates in a spread sheet. Marc[_18_] Excel Programming 5 September 9th 13 09:28 PM
how do i enter a bull call spread into the options spread sheet ? alvin smith Excel Worksheet Functions 0 November 27th 06 01:23 AM
Compare to columns on two different spread sheet, only pick up the Ming[_2_] Excel Programming 1 February 22nd 06 08:28 PM
can I clean old excel data format with macro on funny spread sheet Todd F.[_2_] Excel Programming 0 July 22nd 05 09:15 PM
is there anyway to make it so the users of my excel spread sheet cant view the macro code w/o a password? Daniel Excel Worksheet Functions 2 June 28th 05 05:34 AM


All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"