PC Review


Reply
Thread Tools Rate Thread

Compare 2 excel workbooks

 
 
potentus
Guest
Posts: n/a
 
      6th May 2008
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 With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      6th May 2008
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" <(E-Mail Removed)> wrote in message
news:352a4934-8aef-453c-955c-(E-Mail Removed)...
> 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 With Quote
 
ryguy7272
Guest
Posts: n/a
 
      7th May 2008
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
exitHere:
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" <(E-Mail Removed)> wrote in message
> news:352a4934-8aef-453c-955c-(E-Mail Removed)...
> > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compare variables in two excel workbooks Alex Microsoft Excel Programming 7 29th Oct 2008 11:46 PM
consolidate and compare workbooks in excel SC Diane Microsoft Excel Worksheet Functions 1 19th Sep 2008 04:42 PM
Compare Excel Workbooks Russ.Dilley@gmail.com Microsoft Excel Misc 1 7th Aug 2006 03:17 PM
How do I Compare and Merge Workbooks in Excel? =?Utf-8?B?SGFubmFo?= Microsoft Excel Misc 0 18th Jan 2006 04:28 PM
How can I 'diff' [compare content between] two Excel workbooks? =?Utf-8?B?TW9ydHNtYW4=?= Microsoft Excel Misc 1 20th Jul 2005 03:11 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:00 AM.