ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Worksheet_Change not working when using paste (https://www.excelbanter.com/excel-programming/276149-worksheet_change-not-working-when-using-paste.html)

papou[_7_]

Worksheet_Change not working when using paste
 
Hi all
Excel 2000 SP3
According to values input on a worksheet I am using the worksheet_Change
event to launch some routines.
When values are input manually on the worksheet the worksheet_Change event
works OK
When values are pasted on the worksheet this event does not work.
Is there any way I can make the Worksheet_Change event work when I paste
several values onto my worksheet?
Here's part of my code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Saisie de données dans la plage des colonnes Catégorie à Ext Hor.
If Not Intersect(Range(Target.Address), Range("H12:Q2012")) Is Nothing Then
'Copie des données pour le cas où la cat = 0...
'... et nombre d'infos OK
If Target.Row = 12 And Cells(Target.Row, 8).Value = 0 _
And Cells(Target.Row, 18).Value = True Then
LigCatZero = Target.Row
'Message d'avertissement une seule fois
Select Case Sheets("Saisie AVV").[A12]
Case Is = ""
MsgBox MsgCat0, vbInformation, TitreMsgCat0
AVVCopieCatZero
Case Else
AVVCopieCatZero
End Select
End If
End If
End Sub
Thanks in advance for your help
Regards
Pascal



Tom Ogilvy

Worksheet_Change not working when using paste
 
Only thing I can say is worksheet_change fires in Excel 2000 SR1 when I do a
paste. You have a lot of restrictions in your worksheet_change event - are
you sure it isn't firing, but not passing the tests you have to show
something.

--
Regards,
Tom Ogilvy

"papou" <nspm_@_ wrote in message
...
Hi all
Excel 2000 SP3
According to values input on a worksheet I am using the worksheet_Change
event to launch some routines.
When values are input manually on the worksheet the worksheet_Change event
works OK
When values are pasted on the worksheet this event does not work.
Is there any way I can make the Worksheet_Change event work when I paste
several values onto my worksheet?
Here's part of my code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Saisie de données dans la plage des colonnes Catégorie à Ext Hor.
If Not Intersect(Range(Target.Address), Range("H12:Q2012")) Is Nothing

Then
'Copie des données pour le cas où la cat = 0...
'... et nombre d'infos OK
If Target.Row = 12 And Cells(Target.Row, 8).Value = 0 _
And Cells(Target.Row, 18).Value = True Then
LigCatZero = Target.Row
'Message d'avertissement une seule fois
Select Case Sheets("Saisie AVV").[A12]
Case Is = ""
MsgBox MsgCat0, vbInformation, TitreMsgCat0
AVVCopieCatZero
Case Else
AVVCopieCatZero
End Select
End If
End If
End Sub
Thanks in advance for your help
Regards
Pascal






All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com