View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JE McGimpsey JE McGimpsey is offline
external usenet poster
 
Posts: 4,624
Default How do I Track Changes on Multi-Cell Targets?

Target is just the selected range when the change is made, so to deal
with all selected cells (including multiple areas):

Dim rArea As Range
Dim rCell As Range
For Each rArea In Target.Areas
For Each rCell In rArea
'your individual cell code here
Next rCell
Next rArea

Of course, one can add a layer of complexity, too, if multiple
worksheets are selected:

Dim ws As Worksheet
Dim rArea As Range
Dim rCell As Range
For Each ws in ActiveWindow.SelectedSheets
For Each rArea in ws.Range(Target.Address).Areas
For Each rCell In rArea
'individual cell code
Next rCell
Next rArea
Next ws

In article ,
MikeZz wrote:

In my case, I can't use Share Workbook/Track changes so I created my own
macro to track change history per www.ozgrid.com/VBA/track-changes.htm and
other sources.

The problem is that I can't find anything that will help me track when
multiple cells are the "Target". A good example is if someone grabs a range
of 10 cells and hit's "Delete". My code only looks at single cell targets.
Excel's change-tracking allows that functionality but can't find any place
that explains how to do it.