ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Same data box on two pages? (https://www.excelbanter.com/excel-worksheet-functions/34821-same-data-box-two-pages.html)

mattflow

Same data box on two pages?
 

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


--
mattflow
------------------------------------------------------------------------
mattflow's Profile: http://www.excelforum.com/member.php...o&userid=25129
View this thread: http://www.excelforum.com/showthread...hreadid=386291


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

"mattflow" wrote:


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


--
mattflow
------------------------------------------------------------------------
mattflow's Profile: http://www.excelforum.com/member.php...o&userid=25129
View this thread: http://www.excelforum.com/showthread...hreadid=386291




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com