Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hy!
I use the Worksheet_Change-function for two cells to write to each other. So, I have sheet_1 with cell B1 and sheet_2 with cell B1. Everytime, when the user changes the content of one of them, the other cell changes it's content too. That was easy. But now, the user should be able to insert columns in sheet_1, so it could happen that cell B1 moves to cell C1. So the function worksheet_change will not work correctly anymore. Is it possible to handle this problem or is there no solution? Thanks for your answers! Regards Christian Galbavy |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Christian,
Name the cells... '--------------------- Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = Me.Range("FirstCell").Address Then Sheet2.Range("SecondCell").Value = Target.Value End If End Sub '--------------------- Regards, Jim Cone San Francisco, USA "Christian Galbavy" wrote in message ... Hy! I use the Worksheet_Change-function for two cells to write to each other. So, I have sheet_1 with cell B1 and sheet_2 with cell B1. Everytime, when the user changes the content of one of them, the other cell changes it's content too. That was easy. But now, the user should be able to insert columns in sheet_1, so it could happen that cell B1 moves to cell C1. So the function worksheet_change will not work correctly anymore. Is it possible to handle this problem or is there no solution? Thanks for your answers! Regards Christian Galbavy |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Christian,
Here is an idea. Define two named ranges, say Cell1 and Cell2 with RefersTo values of =$B$1 and =$C$1. In the worksheet event code, test If Target = Range("Cell1") Then etc -- HTH RP (remove nothere from the email address if mailing direct) "Christian Galbavy" wrote in message ... Hy! I use the Worksheet_Change-function for two cells to write to each other. So, I have sheet_1 with cell B1 and sheet_2 with cell B1. Everytime, when the user changes the content of one of them, the other cell changes it's content too. That was easy. But now, the user should be able to insert columns in sheet_1, so it could happen that cell B1 moves to cell C1. So the function worksheet_change will not work correctly anymore. Is it possible to handle this problem or is there no solution? Thanks for your answers! Regards Christian Galbavy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to write the SUM of two MAX numbers in four or more than four cells | New Users to Excel | |||
write a macro for variable cells | Excel Discussion (Misc queries) | |||
Write once cells | Excel Worksheet Functions | |||
Macro to re-write all cells in a column | Excel Programming | |||
Macro to re-write all cells in a column | Excel Programming |