Dynamic Link between two cells on different sheets

BKGLTS

Board Regular
Joined
Aug 27, 2018
Messages
82
Hello,

I need help to link cells dynamically between two sheets.
I found the answer below, but it is not quite on the scale I need it.
If I provided a list of cells (200 pairs) to link could that be quickly formatted into a VBA code that would link them all, without going through this process for each pair?
For example if I provided a list like:

AB
Sheet1!A1Sheet2!F26
Sheet1!A2Sheet2!F36
Sheet1!A3Sheet2!F46


Thank you!
B

----------------------------------------------ANSWER FOUND----------------------------------------------------
If you want a Dynamic link between Cells or Ranges of Cells, between Worksheets or even the Workbooks, for both way data entry, then VBA is the only solution.
You need to write the following VBA code in both the Sheets:
In Sheet 1:
Private Sub Worksheet_change(ByVal Target As Range)

If Not Intersect(Target, Range("A4")) Is Nothing Then
If Target = Range("A4") Then
Sheets("Sheet2").Range("B7").Value = Target.Value
End If
End If

End Sub
In Sheet 2:
Private Sub Worksheet_change(ByVal Target As Range)

If Not Intersect(Target, Range("B7")) Is Nothing Then
If Target = Range("B7") Then
If Sheets("Sheet1").Range("A4").Value <> Target.Value Then
Sheets("Sheet1").Range("A4").Value = Target.Value
End If
End If
End If

End Sub
NB: Code in Sheet 2 will update the Sheet 1 if the values in both cells are not similar. If you don't need this, simply remove the If statement line.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Forum statistics

Threads
1,214,980
Messages
6,122,563
Members
449,088
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top