R
Robert Crandal
I have two different spreadsheets (Spreadsheet's 1 and 2)
that I want to mirror each other. Here is the code that I am
using to achieve this for each sheet:
'
' Worksheet_change() for "Sheet1"
'
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
For Each t In Target
Sheet2.Range(t.Address(0, 0)).Value = t.Value
Next t
Application.EnableEvents = True
End Sub
'
' Worksheet_change() for "Sheet2"
'
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
For Each t In Target
Sheet1.Range(t.Address(0, 0)).Value = t.Value
Next t
Application.EnableEvents = True
End Sub
Does anybody see any flaws in the code above??? I want both sheets
to miror each other exactly at all times, but I noticed in a few situations
that the data on both sheets does not match exactly and I'm puzzled
as to why??
Would anybody mind running the above code and try to find situations
that might break the mirror?? Otherwise, can anybody see a flaw in
the code?
thank you
that I want to mirror each other. Here is the code that I am
using to achieve this for each sheet:
'
' Worksheet_change() for "Sheet1"
'
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
For Each t In Target
Sheet2.Range(t.Address(0, 0)).Value = t.Value
Next t
Application.EnableEvents = True
End Sub
'
' Worksheet_change() for "Sheet2"
'
Private Sub Worksheet_Change(ByVal Target As Range)
Application.EnableEvents = False
For Each t In Target
Sheet1.Range(t.Address(0, 0)).Value = t.Value
Next t
Application.EnableEvents = True
End Sub
Does anybody see any flaws in the code above??? I want both sheets
to miror each other exactly at all times, but I noticed in a few situations
that the data on both sheets does not match exactly and I'm puzzled
as to why??
Would anybody mind running the above code and try to find situations
that might break the mirror?? Otherwise, can anybody see a flaw in
the code?
thank you