Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 276
  • Last Modified:

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
0
joyacv2
Asked:
joyacv2
  • 4
  • 3
1 Solution
 
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
 
Rory ArchibaldCommented:
Oh sorry - I misread the last part of the question. You will need code for this - is that OK?
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
joyacv2Author Commented:
Ok, no problem, perfect
0
 
Rory ArchibaldCommented:
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
 
joyacv2Author Commented:
Works perfect! Exactly what i want!
0
 
joyacv2Author Commented:
Excelent
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now