Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Compare 2 excel workbooks

Hi,

I have 2 excel sheets generated daily :
Daily a
Daily b

I need to compare column A in "Daily a" to Column a in "Daily b" and
show all items that dont appear in both (deltas)
So for example the number 1 only appears in "Daily a" it would be
listed, but if it was in both daily spreadsheets it would not


Thanks


Neo
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 421
Default Compare 2 excel workbooks

Hi Neo,

Try the Compare add-in, created by
Myrna Larson and Bill Manville, which
can be downloaded from the
Downloads page on Chip Pearson's site:

http://www.cpearson.com/Excel/download.htm


---
Regards.
Norman


"potentus" wrote in message
...
Hi,

I have 2 excel sheets generated daily :
Daily a
Daily b

I need to compare column A in "Daily a" to Column a in "Daily b" and
show all items that dont appear in both (deltas)
So for example the number 1 only appears in "Daily a" it would be
listed, but if it was in both daily spreadsheets it would not


Thanks


Neo


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Compare 2 excel workbooks

Use this:
Sub MatchedAandB()
On Error GoTo errHandler
Dim iRowNewProjects As Integer
Dim iRow As Integer
Dim iCol As Integer
Dim wks As Worksheet
Dim colExistingB As New Collection
Dim sTempProjectNumber As String
Dim bFoundDuplicate As Boolean
Set wks = Application.ActiveSheet

iCol = 2
iRow = 2
'Fill collection with check values
Do Until wks.Cells(iRow, iCol).Value = ""
colExistingB.Add wks.Cells(iRow, iCol).Value, CStr(wks.Cells(iRow,
iCol).Value)
iRow = iRow + 1
Loop
'Now run down the column to be checked ('A')
iCol = 1
iRow = 2
iRowNewProjects = iRow
Do Until wks.Cells(iRow, iCol).Value = ""
sTempProjectNumber = wks.Cells(iRow, iCol).Value
For i = 1 To colExistingB.count
If sTempProjectNumber = colExistingB(i) Then
bFoundDuplicate = True
Exit For
End If
Next i
If bFoundDuplicate = False Then
wks.Cells(iRowNewProjects, iCol + 2).Value = sTempProjectNumber
iRowNewProjects = iRowNewProjects + 1
End If
bFoundDuplicate = False
iRow = iRow + 1
Loop
exitHe
Exit Sub
errHandler:
If Err.Number = 457 Then
'Already in collection
Resume Next
Else
MsgBox Err.Description & " (" & Err.Number & ")", vbExclamation
Resume exitHere
End If
End Sub


I didn't develop it; just found it on this DG a while back.

Regards,
Ryan---


--
RyGuy


"Norman Jones" wrote:

Hi Neo,

Try the Compare add-in, created by
Myrna Larson and Bill Manville, which
can be downloaded from the
Downloads page on Chip Pearson's site:

http://www.cpearson.com/Excel/download.htm


---
Regards.
Norman


"potentus" wrote in message
...
Hi,

I have 2 excel sheets generated daily :
Daily a
Daily b

I need to compare column A in "Daily a" to Column a in "Daily b" and
show all items that dont appear in both (deltas)
So for example the number 1 only appears in "Daily a" it would be
listed, but if it was in both daily spreadsheets it would not


Thanks


Neo



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
consolidate and compare workbooks in excel SC Diane Excel Worksheet Functions 1 September 19th 08 04:42 PM
Compare Two Excel Workbooks & Display Discrepancies Dave Excel Discussion (Misc queries) 2 July 19th 07 11:10 PM
Compare Excel Workbooks [email protected] Excel Discussion (Misc queries) 1 August 7th 06 03:17 PM
How do I Compare and Merge Workbooks in Excel? Hannah Excel Discussion (Misc queries) 0 January 18th 06 04:28 PM
How can I 'diff' [compare content between] two Excel workbooks? Mortsman Excel Discussion (Misc queries) 1 July 20th 05 03:11 PM


All times are GMT +1. The time now is 08:12 AM.

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"