+ Reply to Thread
Results 1 to 2 of 2

link cells

  1. #1
    Christian Galbavy
    Guest

    link cells

    Hy!

    I want to link to cells with each other. So, if I change one of the cells,
    the other one should change too. I have only found a way, where you can only
    change one cell, and this will change the other one. But I want to find a
    possibility to do this in both directions.
    Anybody, who has an idea?

    Christian



  2. #2
    Tom Ogilvy
    Guest

    Re: link cells

    you can do this with the change event. Right click on the sheet tab of the
    sheet where you want this behavior and select view code. Put in a macro
    like this one:

    Private Sub Worksheet_Change(ByVal Target As Range)
    On Error GoTo ErrHandler
    If Target.Count > 1 Then Exit Sub
    If Target.Address = "$A$1" Or Target.Address = "$B$10" Then
    Application.EnableEvents = False
    If Target.Address = "$A$1" Then
    Range("B10").Value = Target.Value ^ 2
    Else
    Range("A1").Value = Target.Value ^ 0.5
    End If
    End If
    ErrHandler:
    Application.EnableEvents = True
    End Sub

    As an example, this one synchronizes Cells A1 and B10 so B10 is always the
    square of A1, regardless of where the entry is made - B10 or A1.

    --
    Regards,
    Tom Ogilvy

    "Christian Galbavy" <slater2000@gmx.at> wrote in message
    news:cud0hn$9i7$1@news.siemens.at...
    > Hy!
    >
    > I want to link to cells with each other. So, if I change one of the cells,
    > the other one should change too. I have only found a way, where you can

    only
    > change one cell, and this will change the other one. But I want to find a
    > possibility to do this in both directions.
    > Anybody, who has an idea?
    >
    > Christian
    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1