Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address(False, False) = "A1" Then
Application.EnableEvents = False
Call Macro1
Application.EnableEvents = True
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$G$10" Then
Application.ScreenUpdating = False
'Clear old data first
Sheets("Lateness database").Select
Range("E15:G150").Select
Selection.ClearContents
Range("E15").Select
'Get new selected data from filter
Sheets("Lateness data").Select
Columns("A:D").Select
Selection.AutoFilter Field:=1, Criteria1:=Sheets("Lateness database").Range("G10")
Selection.Copy
Sheets("Lateness database").Select
Range("D14").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
Range("A7").Select
End If
End Sub
Columns("A:D").Select
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$G$10" Then
Application.ScreenUpdating = False
'Clear old data first
Sheets("Lateness database").Range("E15:G150").ClearContents
'Get new selected data from filter
Sheets("Lateness data").Columns("A:D").AutoFilter Field:=1, Criteria1:=Sheets("Lateness database").Range("G10")
Sheets("Lateness data").Columns("A:D").Copy
Sheets("Lateness database").Range("D14").PasteSpecial Paste:=xlValues
End If
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$G$10" Then
Application.ScreenUpdating = False
'Clear old data first
Sheets("Lateness database").Range("E15:G150").ClearContents
'Get new selected data from filter
Sheets("Lateness data").Columns("A:D").AutoFilter Field:=1, Criteria1:=Sheets("Lateness database").Range("G10")
Sheets("Lateness data").Columns("A:D").SpecialCells(xlCellTypeVisible).Copy
Sheets("Lateness database").Range("D14").PasteSpecial Paste:=xlValues
End If
End Sub