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

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Compare and Highlight

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
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
Compare & highlight changes between two worksheets? Katie Excel Worksheet Functions 3 March 7th 09 02:51 PM
Compare and highlight Jamer Excel Programming 1 August 21st 08 06:21 PM
Compare and Highlight Rows Lisab New Users to Excel 12 December 6th 07 03:26 PM
Compare and Highlight Differences RyGuy Excel Programming 5 September 25th 07 03:50 AM
Compare Two Worksheets and Highlight Changes TEAM[_16_] Excel Programming 2 May 10th 06 09:16 PM


All times are GMT +1. The time now is 08:27 PM.

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"