Worksheet_Change problem

  • Thread starter Thread starter Romanian37
  • Start date Start date
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
 
Hi
could you post your code? I would assume you check within
this code that only one cell is changed
 
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
 
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
 
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

:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top