Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("x519:x1518,ab519:ab1518,af519:af1518,aj519:aj1518,an519:an1518,ar519:ar1518,av519:av1518,az519:az1518,bd519:bd1518,bh519:bh1518,bl519:bl1518,bp519:bp1518,bt519:bt1518,bx519:bx1518,cb519:cb1518,cf519:cf1518,cj519:cj1518,cn519:cn1518,cr519:cr1518,cv519:cv1518,cz519:cz1518,dd519:dd1518,dh519:dh1518,dl519:dl1518,dp519:dp1518,dt519:dt1518,dx519:dx1518,eb519:eb1518,ef519:ef1518,ej519:ej1518,en519:en1518,er519:er1518,ev519:ev1518,ez519:ez1518,fd519:fd1518,fh519:fh1518,fl519:fl1518,fp519:fp1518,ft519:ft1518,fx519:fx1518")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' Display a message when one of the designated cells has been
' changed.
' Place your code here.
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
Range(Target.Address).Select
Selection.Copy
Range("x508").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range(Target.Address).Select
End If
End Sub
Bookmarks