Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Created another spread sheet if SSN is not match

I have two excel spread sheet,on sheet1 column D has SSN,on sheet2 column D
has SSN, I need to do the match this two sheet1 and sheet2, if both SSN did
not match, then I need to create on sheet3, show all the different record.

How can I do that in macro?

Thanks.

Lillian
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Created another spread sheet if SSN is not match

Sub ABCF()
Dim rng as Range, rng1 as Range, cell as Range
Dim rng3 as Range
Dim res as Variant
' sheet with longer list of SSN
set rng = Worksheets("Sheet1").Range("D1:D500")
' sheet with shorter list of SSN
set rng1 = Worksheets("Sheet2").Range("D1:D50")
for each cell in rng
res = Application.Match(cell,rng1,0)
if not iserror(res) then
cell.EntireRow.Hidden = True
else
cell.Entirerow.Hidden = False
end if
Next
set rng3 = worksheets("Sheet1").columns(1).specialcells(xlVis ible)
rng3.EntireRow.copy _
Destination:=Worksheets("sheet3").Range("A1")
rng.Parent.Rows.Hidden = False
End Sub

--
Regards,
Tom Ogilvy

"Lillian" wrote in message
...
I have two excel spread sheet,on sheet1 column D has SSN,on sheet2 column

D
has SSN, I need to do the match this two sheet1 and sheet2, if both SSN

did
not match, then I need to create on sheet3, show all the different record.

How can I do that in macro?

Thanks.

Lillian



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Created another spread sheet if SSN is not match

Tom:

I run this report only show 3 records on Sheet3, and I look this 3
records's SSN # are on both Sheet1 and Sheet2, any idea?

I suppose get the records if both Sheet1 and Sheet2 SSN do not match. it
means, if 111-111-1111 on sheet1, but not on sheet2, so I need print out this
record on sheet3.

Thanks.

Lillian


"Tom Ogilvy" wrote:

Sub ABCF()
Dim rng as Range, rng1 as Range, cell as Range
Dim rng3 as Range
Dim res as Variant
' sheet with longer list of SSN
set rng = Worksheets("Sheet1").Range("D1:D500")
' sheet with shorter list of SSN
set rng1 = Worksheets("Sheet2").Range("D1:D50")
for each cell in rng
res = Application.Match(cell,rng1,0)
if not iserror(res) then
cell.EntireRow.Hidden = True
else
cell.Entirerow.Hidden = False
end if
Next
set rng3 = worksheets("Sheet1").columns(1).specialcells(xlVis ible)
rng3.EntireRow.copy _
Destination:=Worksheets("sheet3").Range("A1")
rng.Parent.Rows.Hidden = False
End Sub

--
Regards,
Tom Ogilvy

"Lillian" wrote in message
...
I have two excel spread sheet,on sheet1 column D has SSN,on sheet2 column

D
has SSN, I need to do the match this two sheet1 and sheet2, if both SSN

did
not match, then I need to create on sheet3, show all the different record.

How can I do that in macro?

Thanks.

Lillian




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Created another spread sheet if SSN is not match

In contrast, I ran it on some test data and it worked perfectly for me.

You must be doing something wrong.

--
Regards,
Tom Ogilvy

"Lillian" wrote in message
...
Tom:

I run this report only show 3 records on Sheet3, and I look this 3
records's SSN # are on both Sheet1 and Sheet2, any idea?

I suppose get the records if both Sheet1 and Sheet2 SSN do not match. it
means, if 111-111-1111 on sheet1, but not on sheet2, so I need print out

this
record on sheet3.

Thanks.

Lillian


"Tom Ogilvy" wrote:

Sub ABCF()
Dim rng as Range, rng1 as Range, cell as Range
Dim rng3 as Range
Dim res as Variant
' sheet with longer list of SSN
set rng = Worksheets("Sheet1").Range("D1:D500")
' sheet with shorter list of SSN
set rng1 = Worksheets("Sheet2").Range("D1:D50")
for each cell in rng
res = Application.Match(cell,rng1,0)
if not iserror(res) then
cell.EntireRow.Hidden = True
else
cell.Entirerow.Hidden = False
end if
Next
set rng3 = worksheets("Sheet1").columns(1).specialcells(xlVis ible)
rng3.EntireRow.copy _
Destination:=Worksheets("sheet3").Range("A1")
rng.Parent.Rows.Hidden = False
End Sub

--
Regards,
Tom Ogilvy

"Lillian" wrote in message
...
I have two excel spread sheet,on sheet1 column D has SSN,on sheet2

column
D
has SSN, I need to do the match this two sheet1 and sheet2, if both

SSN
did
not match, then I need to create on sheet3, show all the different

record.

How can I do that in macro?

Thanks.

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
How to create Login & Log out Spread sheet in Excel with automated Attendance sheet marc5354 Excel Worksheet Functions 2 September 21st 10 04:22 PM
spread sheet Marilee Excel Worksheet Functions 2 March 22nd 07 04:55 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
spread sheet equality 547 New Users to Excel 2 May 5th 06 03:51 PM
spread sheet equality 547 Charts and Charting in Excel 1 May 2nd 06 11:10 AM


All times are GMT +1. The time now is 10:27 AM.

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

About Us

"It's about Microsoft Excel"