Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim KeyCells As Range
- Dim OtherCells As Range
- ' The variable KeyCells contains the cells that will
- ' cause an alert when they are changed.
- Set KeyCells = Range("E6")
- 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.
- Range("C20:I10000", Range("C20:I10000").End(xlDown)).Sort Key1:=Range("C20:I10000"), Order1:=xlAscending, Header:=xlNo
- Sheet2.Range("C19:C100").AutoFilter Field:=1, Criteria1:=KeyCells.Value
- End If
- If Application.Intersect(KeyCells, Range(Target.Address)) _
- Is Nothing Then
- ActiveSheet.AutoFilterMode = False
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement