Worksheet link

Hi, i want to know how to create a link between worksheets in the same workbook.

Example: i enter 25 in the sheet1 A1, this automatically appears in sheet2 A1 and if i enter 35 in sheet2 A1 then the value in sheet1 A1 change to 35, any idea?

This cannot be done with a formula
LVL 1
joyacv2Asked:
Who is Participating?
 
Rory ArchibaldConnect With a Mentor Commented:
Right-click the tab for Sheet1, choose View Code then paste this in:
Private Sub Worksheet_Change(ByVal Target As Range)
   On Error Resume Next
   Application.EnableEvents = False
   Sheets("Sheet2").Range(Target.Address).Value = Target.Value
   Application.EnableEvents = True
End Sub

Open in new window


repeat for Sheet2, but changing the Sheets("Sheet2") part to Sheets("Sheet1")
0
 
Rory ArchibaldCommented:
>>"This cannot be done with a formula"

Can I ask why not?
0
 
joyacv2Author Commented:
Because when you write in the cell A1 in the sheet 2 for example, and the cell contains a formula "=sheet1!A1", you erase the formula. The link can be done one way using a formula, but how i can do in two way. I will use this for the entire sheet. Thank you for your help!
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
Rory ArchibaldCommented:
Oh sorry - I misread the last part of the question. You will need code for this - is that OK?
0
 
joyacv2Author Commented:
Ok, no problem, perfect
0
 
joyacv2Author Commented:
Works perfect! Exactly what i want!
0
 
joyacv2Author Commented:
Excelent
0
All Courses

From novice to tech pro — start learning today.