Same data box on two pages?

M

mattflow

Is it possible to have the same data box on two sheets, such that you
can change either box and they both change?
 
R

Rowan

Assuming you are meaing a cell when you say data box then you can achieve
this using the change events on the sheets. So if you want to have cell A1 on
Sheet2 equal whatever is in cell A1 on Sheet1 and vice versa then right click
on the Sheet1 sheet tab and select View code. Paste this macro onto the code
sheet:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.EnableEvents = False
Sheets("Sheet2").Range("A1").Value = Target.Value
Application.EnableEvents = True
End If
End Sub

The right click on the Sheet2 sheet tab, select view code and past this macro:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Application.EnableEvents = False
Sheets("Sheet1").Range("A1").Value = Target.Value
Application.EnableEvents = True
End If
End Sub

Now if you change cell A1 on either sheet, A1 on the other sheet will also
change.

Hope this helps
Rowan
 
Top