#1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Duplication

" Wonderer" wrote
I need to know how to have two cells contain the same information, on the
same sheet, so that when I change on cell, the other will reflect that
change. How do I do that?


If you put in say, F1: =IF(A1="","",A1)
F1 will reflect the input in A1.
If A1 is cleared, F1 will display a blank: ""
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Duplication

Wondereer is looking for a change in EITHER cell getting reflected in the
other cell. In other words, there can be no dependencies other than what VBA
imposes through code.



Option Explicit

'Be Sure You Have Defined The Range FirstRef and
'SecondRef appropriately

Private Sub Worksheet_Change(ByVal Target As Range)
'Code to make changes in one reference range get
'automatically made in another, bi-directionally

Static IgnoreMyChange As Boolean

If IgnoreMyChange Then
IgnoreMyChange = False
Exit Sub
End If

If Replace$(Target.Address, "$", "") = _
Replace$(Range("firstref").Address, "$", "") Then
'Target was firstref, set secondref
IgnoreMyChange = True
Range("SecondRef").Value = Range("FirstRef").Value
IgnoreMyChange = False
Exit Sub
End If

If Replace$(Target.Address, "$", "") = _
Replace$(Range("SecondRef").Address, "$", "") Then
'Target was firstref, set secondref
IgnoreMyChange = True
Range("FirstRef").Value = Range("Secondref").Value
IgnoreMyChange = False
Exit Sub
End If
End Sub




"Max" wrote in message
...
" Wonderer" wrote
I need to know how to have two cells contain the same information, on the
same sheet, so that when I change on cell, the other will reflect that
change. How do I do that?


If you put in say, F1: =IF(A1="","",A1)
F1 will reflect the input in A1.
If A1 is cleared, F1 will display a blank: ""
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 121
Default Duplication

one of my comment lines repeats -

2nd instance of ''Target was firstref, set secondref' should say

'Target was SecondRef, set FirstRef

Sorry

"William Benson" wrote in message
...
Wondereer is looking for a change in EITHER cell getting reflected in the
other cell. In other words, there can be no dependencies other than what
VBA imposes through code.



Option Explicit

'Be Sure You Have Defined The Range FirstRef and
'SecondRef appropriately

Private Sub Worksheet_Change(ByVal Target As Range)
'Code to make changes in one reference range get
'automatically made in another, bi-directionally

Static IgnoreMyChange As Boolean

If IgnoreMyChange Then
IgnoreMyChange = False
Exit Sub
End If

If Replace$(Target.Address, "$", "") = _
Replace$(Range("firstref").Address, "$", "") Then
'Target was firstref, set secondref
IgnoreMyChange = True
Range("SecondRef").Value = Range("FirstRef").Value
IgnoreMyChange = False
Exit Sub
End If

If Replace$(Target.Address, "$", "") = _
Replace$(Range("SecondRef").Address, "$", "") Then
'Target was firstref, set secondref
IgnoreMyChange = True
Range("FirstRef").Value = Range("Secondref").Value
IgnoreMyChange = False
Exit Sub
End If
End Sub




"Max" wrote in message
...
" Wonderer" wrote
I need to know how to have two cells contain the same information, on
the
same sheet, so that when I change on cell, the other will reflect that
change. How do I do that?


If you put in say, F1: =IF(A1="","",A1)
F1 will reflect the input in A1.
If A1 is cleared, F1 will display a blank: ""
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----






  #4   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Duplication

My apologies for the mis-read.
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----


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
Duplication Lorenza@hsccs Excel Worksheet Functions 1 May 5th 10 06:10 PM
Duplication PMST Excel Discussion (Misc queries) 2 February 19th 08 03:18 PM
Duplication Welthey Excel Discussion (Misc queries) 2 January 15th 07 09:48 PM
How-to Prevent Value Duplication StrapJr Excel Discussion (Misc queries) 1 November 28th 06 03:57 PM
Data duplication No Name Excel Programming 1 June 14th 04 05:14 PM


All times are GMT +1. The time now is 10:01 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"