#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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" wrote in message
...
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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Link All cells of Sheet1 to All Cells of Sheet2 Irshad Alam Links and Linking in Excel 1 January 10th 10 08:37 AM
need to paste link from 4 vertical cells to 4 horizontal cells? cioangel Excel Discussion (Misc queries) 6 June 8th 09 06:44 PM
How do I link cells in 1 spreadsheet to Specific cells in another IrishEyes Excel Discussion (Misc queries) 0 November 14th 07 01:05 PM
PASTE LINK FROM HORIZONTAL CELLS TO VERTICAL CELLS Luis P. Excel Discussion (Misc queries) 2 August 9th 07 04:20 PM
How do I link a row of cells in wks 1 to update diff cells wks 2 Andy Excel Worksheet Functions 1 February 10th 06 04:27 PM


All times are GMT +1. The time now is 09:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"