Two Way Cell Value Connection A1-C1 and C1-A1
Hi Shaun,
Try this in the Worksheet module (right click the sheet tab View code)
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo errH
If Not Intersect(Target, Range("A1,C1")) Is Nothing Then
Application.EnableEvents = False
If Target(1).Address = "$A$1" Then
Range("C1").Value = Range("A1").Value
Else
Range("A1").Value = Range("C1").Value
End If
End If
errH:
Application.EnableEvents = True
End
Regards,
Peter T
"Shaun" wrote in message
oups.com...
Hello,
I am wondering if anyone knows a visual basic method to update the
values of two cells in visual basic so one is equal to the other if it
changes.
For example, if I change A1 to be "5" I want C1 to be updated to "5"
_and_ if I change C1 to be "5" I want A1 to be updated to "5" as well.
I've been searching for a cell(s).change option but was not able to
find that function, does anyone have any suggestions or guesses?
Thanks everyone for your help!
Shaun
|