Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Mirrored Cells

  1. #1
    New Member
    Join Date
    May 2002
    Posts
    5
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Is there a way of having two cells mirror each other. In other words if I enter a value in cell A I want it to also appear in cell B. Likewise, if I enter a value in cell B I want it to appear in cell A.

    Thanks.

  2. #2
    MrExcel MVP
    Join Date
    Mar 2002
    Location
    Michigan USA
    Posts
    11,454
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-05-09 15:48, phillyfilms wrote:
    Is there a way of having two cells mirror each other. In other words if I enter a value in cell A I want it to also appear in cell B. Likewise, if I enter a value in cell B I want it to appear in cell A.

    Thanks.
    I wonder why you would want to do it! ... anyway, this is what I tried -- in column A,

    I put the formula
    =OFFSET(A:A,0,1)

    and in column B, I put the formula
    =OFFSET(B:B,0,-1)

    The entries do mirror, however as oon as you enter a value in one of the cells, the formula in that cell is gone. So the mirroring is for one time entry only.

    I am sure some Excel GURUs will come up with a more viable option.
    Regards!

    Yogi Anand, D.Eng, P.E.
    Energy Efficient Building Network LLC
    www.energyefficientbuild.com

  3. #3
    MrExcel MVP
    Join Date
    Apr 2002
    Location
    Vancouver BC , Canada
    Posts
    6,259
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Here's some code that will do the trick:

    Code:
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    
       ' mirror values between colA & colB
       If Target.Column = 1 Then Cells(Target.Row, Target.Column + 1).Value = Target
       If Target.Column = 2 Then Cells(Target.Row, Target.Column - 1).Value = Target
    
    End Sub

    OR THIS CODE

    Code:
    Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
    
       ' mirror values between colA & colB
       If Target.Column = 1 Then Cells(Target.Row, 2).Value = Target
       If Target.Column = 2 Then Cells(Target.Row, 1).Value = Target
    
    End Sub

    [ This Message was edited by: Nimrod on 2002-05-09 16:42 ]

    [ This Message was edited by: Nimrod on 2002-05-09 16:48 ]

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •