LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Problem with sheets that mirror each other

As an idea would the followng approach do what you want??

'sheet 1
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng1 As Range
Dim rng2 As Range

Application.EnableEvents = False

Sheets(2).Cells.ClearContents

Set rng1 = Sheets(1).UsedRange

Set rng2 = Sheets(2).Range("A1")

rng1.Copy rng2

Application.EnableEvents = True

End Sub

'sheet 2
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rng1 As Range
Dim rng2 As Range

Application.EnableEvents = False

Sheets(1).Cells.ClearContents

Set rng1 = Sheets(2).UsedRange

Set rng2 = Sheets(1).Range("A1")

rng1.Copy rng2

Application.EnableEvents = True

End Sub


--
jb


"Robert Crandal" wrote:

I have TWO different layouts, a red and blue layout, each with
slightly different dimensions. It gives the user 2 different ways
of instantly looking at the data. When the red sheet is toggled on,
I hide the blue sheet and the unhide the red sheet (or vice versa).

So, you see, the user only sees one sheet at a time, and I want them
to have similar data at all times. My mirror plan works except for
case when a block is highlighted and then deleted with the "Delete"
key, as the deleted cells dont all seem to copy over for some reason.

Got any ideas?


"OssieMac" wrote in message
...
Hi Robert,

Perhaps you would like to share the reason for mirroring the 2 sheets.
There
might be a more efficient way of achieving this like copying the sheet
before
close or save etc.

--
Regards,

OssieMac


"Robert Crandal" wrote:

I'm trying to setup that mirror each other at all times. I am currently
handling "Worksheet_Change()" in my sheets, so any time one
sheet gets modified, I am trying to copy the contents of one sheet
to the other.

The shortened code looks as follows:

'
' Sheet 1
'
Private Sub Worksheet_Change(ByVal Target As Range)
changedCell = Target(1).Address(0, 0)
Sheet2.Range(changedCell).Value = Sheet1.Range(changedCell).Value
End Sub

'
' Sheet 2
'
'Private Sub Worksheet_Change(ByVal Target As Range)
changedCell = Target(1).Address(0, 0)
Sheet1.Range(changedCell).Value = Sheet2.Range(changedCell).Value
End Sub

This code generally works when a user changes one cell at a time.
However,
(for example) if a user selects a big block of cells on Sheet1 and
presses
the DELETE key, that block of cells will actually delete on Sheet1, but
only
one (or two or so) cells will delete from Sheet2.

How can I modify the subroutines above to handle cases when a block of
data is highlighted in one sheet, then tell the second sheet to delete
all
those
cells as well??

Thank you!!!



.


.

 
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
synchronizing mutiple sheets to mirror the previous data FEMoore Excel Discussion (Misc queries) 0 October 10th 10 03:49 PM
sheets that mirror each other Robert Crandal Excel Programming 8 December 5th 09 01:54 PM
Mirror Wildcard? thecdnmole Excel Worksheet Functions 2 August 22nd 09 06:59 PM
Mirror value to another cell. Eric Excel Programming 2 July 31st 08 03:59 AM
Mirror Workbook karenp Excel Programming 3 December 1st 07 12:50 AM


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