PC Review


Reply
Thread Tools Rate Thread

Compare and Highlight

 
 
SarahJ
Guest
Posts: n/a
 
      11th Dec 2008
I need help figuring out how to do the following.

I have 2 work books "Book1" and "Book2"
Columns A & B of Sheet1 in both workbooks contain First Names and Last Names.

I want to compare the workbooks and if the name in Book1 appears in Book2 I
want it highlighted in Book1.

Is this possible?
 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      11th Dec 2008
Try this:
Sub Compare2Shts()
For Each Cell In Worksheets("CompareSheet#1").UsedRange
If Cell.Value <> Worksheets("CompareSheet#2").Range(Cell.Address) Then
Cell.Interior.ColorIndex = 3
End If
Next

For Each Cell In Worksheets("CompareSheet#2").UsedRange
If Cell.Value <> Worksheets("CompareSheet#1").Range(Cell.Address) Then
Cell.Interior.ColorIndex = 3
End If
Next
End Sub


Sub CompareAnother2Shts()
For Each Cell In Worksheets("CompareSheet#1").Range("A1:J50")
If Cell.Value <> Worksheets("CompareSheet#2").Range(Cell.Address) Then
Cell.Interior.ColorIndex = 3
End If
Next

For Each Cell In Worksheets("CompareSheet#2").Range("A1:J50")
If Cell.Value <> Worksheets("CompareSheet#1").Range(Cell.Address) Then
Cell.Interior.ColorIndex = 3
End If
Next
End Sub


Regards,
Ryan---

--
RyGuy


"SarahJ" wrote:

> I need help figuring out how to do the following.
>
> I have 2 work books "Book1" and "Book2"
> Columns A & B of Sheet1 in both workbooks contain First Names and Last Names.
>
> I want to compare the workbooks and if the name in Book1 appears in Book2 I
> want it highlighted in Book1.
>
> Is this possible?

 
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 & highlight data Decreenisi Microsoft Excel Programming 0 22nd Jun 2009 07:40 AM
Compare & highlight changes between two worksheets? Katie Microsoft Excel Worksheet Functions 2 7th Mar 2009 02:51 PM
Compare and highlight Jamer Microsoft Excel Programming 1 21st Aug 2008 06:21 PM
Compare and highlight differences Sheila Innes Microsoft Word Document Management 2 15th May 2008 05:28 PM
Compare and Highlight Differences =?Utf-8?B?UnlHdXk=?= Microsoft Excel Programming 5 25th Sep 2007 03:50 AM


Features
 

Advertising
 

Newsgroups
 


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