Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
RFJ
 
Posts: n/a
Default Comparing Two Worksheets

I've got two worksheets of identical layout each comprising multiple tables
of numerical information.

Is there a way I can automatically highlight cells in one worksheet where
the corresponding value in the other worksheet is different.

TIA

RobJ


  #2   Report Post  
Chip Pearson
 
Posts: n/a
Default

There is no way to do this automatically. You need to use some
VBA code to do it. For example,

Sub AAA()
Dim RngAddr As String
Dim Rng As Range
Dim Rng2 As Range

For Each Rng In Worksheets("Sheet1").UsedRange.Cells
Set Rng2 = Worksheets("Sheet2").Range(Rng.Address)
If Rng < Rng2 Then
Rng2.Interior.ColorIndex = 5
End If
Next Rng
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"RFJ" wrote in message
...
I've got two worksheets of identical layout each comprising
multiple tables of numerical information.

Is there a way I can automatically highlight cells in one
worksheet where the corresponding value in the other worksheet
is different.

TIA

RobJ



  #3   Report Post  
Max
 
Posts: n/a
Default

One way could be via conditional formatting (CF), but we need to mirror the
tables over on one of the 2 sheets, as CF doesn't allow cross references to
other sheets (at least in xl97, that is)

Assume a table in Sheet1's A1:C3 is to be compared with the identically
placed one in Sheet2's A1:C3, with the highlighting done in Sheet2's table

In Sheet2
-----
Put in say, A5: =IF(Sheet1!A1="","",Sheet1!A1)
Copy A5 across and down to C7 to mirror Sheet1's table

Then select A1:C3 (with A1 active),
Click Format Conditional Formatting
Under Condition 1, make the settings:
Formula is| =A1<A5
Click Format button Patterns tab Yellow ? OK
Click OK at the main dialog

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"RFJ" wrote in message
...
I've got two worksheets of identical layout each comprising multiple

tables
of numerical information.

Is there a way I can automatically highlight cells in one worksheet where
the corresponding value in the other worksheet is different.

TIA

RobJ




  #4   Report Post  
Dave Peterson
 
Posts: n/a
Default

One more way if you're not using format|conditional formatting.

Select your range on sheet1 (I used A1:X99).

With A1 the activecell
format|Conditional formatting
formula is: =A1<INDIRECT("'sheet2'!rc",0)

give it a nice format



RFJ wrote:

I've got two worksheets of identical layout each comprising multiple tables
of numerical information.

Is there a way I can automatically highlight cells in one worksheet where
the corresponding value in the other worksheet is different.

TIA

RobJ


--

Dave Peterson
  #5   Report Post  
Max
 
Posts: n/a
Default

Splendid, Dave ! Thanks.
Direct, simple way to do it using CF.
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--




  #6   Report Post  
RFJ
 
Posts: n/a
Default

And, with a minor amendment it works across different spreadsheets - my
ultimate goal <BG. Thanks Dave

=A1<INDIRECT("'[file1.xls]sheet2'!rc",0)




"Dave Peterson" wrote in message
...
One more way if you're not using format|conditional formatting.

Select your range on sheet1 (I used A1:X99).

With A1 the activecell
format|Conditional formatting
formula is: =A1<INDIRECT("'sheet2'!rc",0)

give it a nice format



RFJ wrote:

I've got two worksheets of identical layout each comprising multiple
tables
of numerical information.

Is there a way I can automatically highlight cells in one worksheet where
the corresponding value in the other worksheet is different.

TIA

RobJ


--

Dave Peterson



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
Vlookup - Comparing two lists in different worksheets Lozby Excel Worksheet Functions 3 August 9th 05 12:14 PM
Comparing 2 worksheets Cube Farmer Excel Worksheet Functions 0 July 20th 05 06:50 PM
Comparing Data Between Worksheets Bryan Excel Discussion (Misc queries) 2 July 19th 05 01:29 PM
Comparing two columns in two different worksheets stevel Excel Worksheet Functions 4 May 31st 05 01:43 PM
Comparing data in two similar worksheets HiRllr21 Excel Discussion (Misc queries) 0 February 2nd 05 05:01 PM


All times are GMT +1. The time now is 06:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"