Mirrored Cells

Joined
Feb 8, 2002
Messages
3,389
Office Version
  1. 365
Platform
  1. Windows
I am posting this on behalf of a reader....

I need to set up two text cells such that whatever I type into either of them automatically goes into both of them. Any formula I've tried (even using alternate cells as pointers) produces formulas with circular references. How can this be accomplished?

Thanks in advance.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Not sure about a formula, but the following worksheet event code will put whatever's typed in cells in column A into the adjacent cell in column B and vice versa, if that's any help: -

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    Select Case Target.Column
    Case 1
        Cells(Target.Row, 2) = Target.Value
    Case 2
        Cells(Target.Row, 1) = Target.Value
    End Select

End Sub
 
Upvote 0
Solution
To prevent the event handler being called recursively, you should turn off EnableEvents when you change the cells:

Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    Application.EnableEvents = False

    Select Case Target.Column
    Case 1
        Cells(Target.Row, 2) = Target.Value
    Case 2
        Cells(Target.Row, 1) = Target.Value
    End Select
    Application.EnableEvents = True

End Sub
 
Upvote 0

Forum statistics

Threads
1,214,872
Messages
6,122,025
Members
449,060
Latest member
LinusJE

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