Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
consolidate and compare workbooks in excel | Excel Worksheet Functions | |||
Compare Two Excel Workbooks & Display Discrepancies | Excel Discussion (Misc queries) | |||
Compare Excel Workbooks | Excel Discussion (Misc queries) | |||
How do I Compare and Merge Workbooks in Excel? | Excel Discussion (Misc queries) | |||
How can I 'diff' [compare content between] two Excel workbooks? | Excel Discussion (Misc queries) |