Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default cells, which write to each other

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default cells, which write to each other

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default cells, which write to each other

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
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
How to write the SUM of two MAX numbers in four or more than four cells Intel New Users to Excel 3 April 1st 23 09:55 PM
write a macro for variable cells Garry Excel Discussion (Misc queries) 0 March 22nd 06 07:45 PM
Write once cells HuckinD Excel Worksheet Functions 3 October 17th 05 11:23 AM
Macro to re-write all cells in a column Gord Dibben Excel Programming 3 August 11th 04 07:43 PM
Macro to re-write all cells in a column Tom Ogilvy Excel Programming 0 August 10th 04 10:57 PM


All times are GMT +1. The time now is 03:51 PM.

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"