Highlight in Sheet2 a change in Sheet1

jcastro

New Member
Joined
Dec 1, 2008
Messages
14
I need to highlight changes in a workbook but, in addition to the cell that's changed, I need to highlight a cell in another worksheet. For example, Sheet1 cell B4 equals 2 and Sheet2 cell E4 contains =Sheet1!B4. When I change the 2 to a 3, the cell in Sheet1 is highlighted. Sheet2 shows the new value but is not highlighted because the content of the cell, the formula, has not changed. I understand the "why" but I don't know how to make it do what I want.

Track Changes from the menu bar doesn't help and I know how to Conditional Format depending on a cell value but not how to apply it based on a change. So far, I've copied the following code I found here to each sheet (14 sheets total) but it only highlights the cell itself.

<CODE>
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.Color = vbCyan
End Sub
</CODE>

Any insight will be greatly appreciated. Thanks!
JCastro
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.Color = vbCyan
Sheets("Sheet2").Range(Target.Address).Interior.Color = vbCyan
End Sub
 
Upvote 0
I appreciate the help. But the cell in Sheet2 is not the same cell address as in Sheet1. They're both in the same row but not in the same column. For example, I need the change in Sheet1!B4 hightlighted in Sheet2!E4. Thanks!

JCastro
 
Upvote 0
Try

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.Color = vbCyan
Sheets("Sheet2").Range(Target.Address).Offset(, 3).Interior.Color = vbCyan
End Sub
 
Upvote 0
Thanks again, VoG. I'm not sure if I should continue in this thread or start a new one. The added wrinkle is that I'm changing cells in several columns and the "related" cells in other sheets are not in the same positions.

In other words, changes in Sheet1 column B cells need to be highlighted in Sheet2 column E but changes in Sheet1 column G cells need to be highlighted in Sheet2 column F. And changes in in Sheet1 column H cells need to be highlighted in Sheet3! It would seem that I need code tied to a cell more than a specific sheet.
 
Upvote 0
If there aren't zillions of related columns then the following approach should be OK.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Target.Interior.Color = vbCyan
If Target.Column = 2 Then
    Sheets("Sheet2").Range(Target.Address).Offset(, 3).Interior.Color = vbCyan
ElseIf Target.Column = 7 Then
    Sheets("Sheet2").Range(Target.Address).Offset(, -1).Interior.Color = vbCyan
ElseIf Target.Column = 8 Then
    Sheets("Sheet3").Range(Target.Address).Interior.Color = vbCyan
End If
End Sub
 
Upvote 0
I'm going to test this code this afternoon (in Florida). There aren't that many columns so this should work. Thank you!

JCastro
 
Upvote 0
It worked excellent! I tailored the sheet names and columns to each of the 14 sheets in my workbook and learned quite a bit in the process. Thanks again, VoG!
 
Upvote 0

Forum statistics

Threads
1,214,614
Messages
6,120,525
Members
448,969
Latest member
mirek8991

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