Worksheet_Change problem

R

Romanian37

I'm using worksheet_change to flag up when a user changes values withi
a specific range in a sheet.

This works fine when the user enters data individually in each cell
but doesn't work when I either fill down / copy and paste / delete
selection of cells. Only the first cell of the selection seems to b
flagged.

Is this just a feature of worksheet change or can I get round this ( a
any given time the user could change one of 10,000+ cells) ?

The only way I can think of is to take a copy of the sheet befor
changes and then compare any changes, which (given memory constraints
is not something I'm keen on.

Any help much appreciated

Cheer
 
F

Frank Kabel

Hi
could you post your code? I would assume you check within
this code that only one cell is changed
 
R

Romanian37

Private Sub Worksheet_Change(ByVal Target As Range)
Application.ScreenUpdating = False

Dim changecolumn As Integer
Dim changerow As Integer
dim changeworker as String


changecolumn = Target.Column
changerow = Target.Row
changeworker = 0

If changecolumn >= 89 Then Exit Sub


Set ThisWorksheet = ActiveSheet
Call change_flag(changerow, 1000, ThisWorksheet, changeworker)




End Su
 
F

Frank Kabel

Hi
try:

Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range
Dim changecolumn As Integer
Dim changerow As Integer
Dim changeworker As String

On Error GoTo errhandler:
Application.ScreenUpdating = False
Application.EnableEvents = False

For Each cell In Target
changecolumn = cell.Column
changerow = cell.Row
changeworker = 0
If changecolumn >= 89 Then Exit For
Call change_flag(changerow, 1000, Me, changeworker)
Next

errhandler:
Application.EnableEvents = True
End Sub
 
R

Romanian37

Frank,

It seems to be working for copy and pasting, but not for filling dow
(which I can get around pretty easily).

Thanks very much for your help.

Will

:
 
Top