Forum Discussion
waldhari1365
Mar 02, 2021Copper Contributor
Linking Two Cells Together (complex)
Does anyone know if one could equate two cells in Excel, say A1 and C1, such that if I change A1, then C1 will change to reflect the data of A1, and if I change C1, A1 will reflect the data of C1? I don't believe formulas will permit this since when you enter data into a cell, it removes the formula. But perhaps Excel has another tool for this?
1 Reply
- JMB17Bronze Contributor
You will need vba for that. If you right click on your worksheet tab, select 'view code', and then paste this into the code module that appears. Then close the vba window.
Private Sub Worksheet_Change(ByVal Target As Range) Dim myRange As Range: Set myRange = Union(Me.Range("A1"), Me.Range("C1")) If Not Intersect(Target, myRange) Is Nothing Then Application.EnableEvents = False myRange.Value = Target.Value Application.EnableEvents = True End If End Sub