To have three cells in three different worksheets reflect the same value and be able to update the value from any of the cells, you can use a combination of cell linking and VBA (Visual Basic for Applications) code to achieve this. Here's how to do it:
-
Open your Excel workbook and go to each of the three worksheets where you want to have these cells. In this example, let's say you want to link cells A1 in Sheet1, A1 in Sheet2, and A1 in Sheet3.
-
Click on the cell A1 in Sheet2, type the equal sign "=", and then click on cell A1 in Sheet1. Press Enter. This will link Sheet2's A1 value to Sheet1's A1 value.
-
Click on the cell A1 in Sheet3, type the equal sign "=", and then click on cell A1 in Sheet1 again. Press Enter. This will link Sheet3's A1 value to Sheet1's A1 value.
-
Now, we'll use VBA to ensure that changing the value in any of the three cells updates the other two cells. Press Alt + F11 to open the VBA Editor.
-
In the VBA Editor, double-click on the "Sheet1" object in the Project Explorer window. This will open the Sheet1 code module.
-
In the Sheet1 code module, paste the following VBA code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Sheets("Sheet2").Range("A1").Value = Target.Value
Sheets("Sheet3").Range("A1").Value = Target.Value
End If
End Sub
- Now, double-click on the "Sheet2" object in the Project Explorer window and paste the following VBA code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Sheets("Sheet1").Range("A1").Value = Target.Value
Sheets("Sheet3").Range("A1").Value = Target.Value
End If
End Sub
- Finally, double-click on the "Sheet3" object in the Project Explorer window and paste the following VBA code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Sheets("Sheet1").Range("A1").Value = Target.Value
Sheets("Sheet2").Range("A1").Value = Target.Value
End If
End Sub
- Close the VBA Editor by clicking the "X" button in the top-right corner.
Now, if you change the value in any of the linked cells (A1 in Sheet1, Sheet2, or Sheet3), the other two cells will automatically update to reflect the same value.
Remember to save your workbook as an Excel Macro-Enabled Workbook (.xlsm) to ensure the VBA code is saved and functional.