*Updated Question*...on creating a Bi-directional (two-way) Link in Excel that can link multiple rows and columns?? (You all are amazing!)

Status
Not open for further replies.

louperrotta

New Member
Joined
Jul 30, 2024
Messages
20
Office Version
  1. 365
Platform
  1. Windows
I want to create a Bi-directional (two-way) Link in Excel that can link multiple rows and columns!

First off, thank you to StephenCrump for the VBA for bi-directional linking multiple cells in a column! Awesome!

Again, I'm very much a layman, I got help from StephenCrump on the VBA code for one column which was -

'In Sheet1 module
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("A1:A20")) Is Nothing Then
Application.EnableEvents = False
Sheets("Sheet2").Range("B1:B20").Value = Range("A1:A20").Value
Application.EnableEvents = True
End If

End Sub
'In Sheet2 module
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("B1:B20")) Is Nothing Then
Application.EnableEvents = False
Sheets("Sheet1").Range("A1:A20").Value = Range("B1:B20").Value
Application.EnableEvents = True
End If

End Sub

BUT... to make it harder haha, I wanted to bi-directionally connect/link, say Sheet1 - (A1:A100, B1:B100, etc.) with Sheet2 (A1:A100, B1:B100, etc.) and vice versa .... so I tried -

Sheet1
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("A1:A20,B1:B20")) Is Nothing Then
Application.EnableEvents = False
Sheets("Sheet2").Range("A1:A20,B1:B20").Value = Range("A1:A20,B1:B20").Value
Application.EnableEvents = True
End If

End Sub

Sheet2
Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("B1:B20,A1:A20")) Is Nothing Then
Application.EnableEvents = False
Sheets("Sheet1").Range("B1:B20,A1:A20").Value = Range("B1:B20,A1:A20").Value
Application.EnableEvents = True
End If

End Sub

And...I can't get the code to work, I obviously must be doing something wrong, what do you all think? I appreciate you all and thank you in advance!!! You all are amazing!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Status
Not open for further replies.

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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