Conditional Formatting

G

Guest

Guest
I keep a workbook with two worksheets in it. The first contains a list of all of our, and our competitor's, products, capacities, etc. by location. This information is based on widely published (Annual reports, websites, etc.) data.

The second is nearly a duplicate of the first, but adjustments are made based on any additional (less reliable?) sources (trade conference conversations, newspaper articles, etc.).

Initially, I set the second worksheet to just read the values of the first. Then when I started adding modified entries to the second worksheet, I manually formatted the second page entries to make them standout.

Is there an easy way to use the Conditional Format capability across different worksheets (i.e. if Sheet1!A1 <> Sheet2!A1, format red)?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
As far as I know you cannot reference across worksheets or workbooks using conditional formatting. It should be possible to do this via a macro, I'm sure someone'll oblige :).
 
Upvote 0
Actually, the following seems to work OK: -

Public Sub CompareSheets()

Dim Sheet1Range As Range
Dim Sheet2Range As Range
Dim c As Range

Set Sheet1Range = Sheet1.UsedRange
Set Sheet2Range = Sheet2.UsedRange
Application.ScreenUpdating = False

For Each c In Sheet2Range
If c.Value<> Sheet1.Range(c.Address) Then
c.Font.ColorIndex = 3
End If
Next c

Application.ScreenUpdating = True

End Sub
This message was edited by Mudface on 2002-03-13 07:28
 
Upvote 0
On 2002-03-13 07:12, Anonymous wrote:
I keep a workbook with two worksheets in it. The first contains a list of all of our, and our competitor's, products, capacities, etc. by location. This information is based on widely published (Annual reports, websites, etc.) data.

The second is nearly a duplicate of the first, but adjustments are made based on any additional (less reliable?) sources (trade conference conversations, newspaper articles, etc.).

Initially, I set the second worksheet to just read the values of the first. Then when I started adding modified entries to the second worksheet, I manually formatted the second page entries to make them standout.

Is there an easy way to use the Conditional Format capability across different worksheets (i.e. if Sheet1!A1 <> Sheet2!A1, format red)?

Select the relevant cells in column A of Sheet1, go the Name Box on the Formula Bar, type DATA, and enter.

Select the relevant A-cells in Sheet2.

Activate Format|Conditional Formatting.

Choose 'Formula is' for Condition 1.

Enter in the formula box:

=ISNA(MATCH(A2,DATA,0))

where I assume that the data start in A2 in Sheet2 (otherwise adjust to suit).

Activate Format.

Choose red on the Patterns tab.

Click OK, OK.
 
Upvote 0

Forum statistics

Threads
1,214,589
Messages
6,120,416
Members
448,960
Latest member
AKSMITH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top