Eleutheros
New Member
- Joined
- Feb 13, 2022
- Messages
- 2
- Office Version
- 2019
- 2016
- Platform
- Windows
- Mobile
- Web
Hello, everyone
I have a database Technical Incidents reported by third party as shown in my attached file
I need to do an autofilter that filters the "In Progress" and "Closed" data and let Show only "In Progress" Incidents (Excel VBA)
the "Closed" data must be systematically copied from the "Incidents" sheet to the "Archive" sheet which contains a similar table as the incident is "Closed"
thank you for your help
I tried this code is it bug
I have a database Technical Incidents reported by third party as shown in my attached file
I need to do an autofilter that filters the "In Progress" and "Closed" data and let Show only "In Progress" Incidents (Excel VBA)
the "Closed" data must be systematically copied from the "Incidents" sheet to the "Archive" sheet which contains a similar table as the incident is "Closed"
thank you for your help
I tried this code is it bug
VBA Code:
Private Sub Worksheet_Change(ByVal target As Range)
If target <> "" And target.Column = 10 Then Call copie(target): Exit Sub
Set isct = Intersect(target, Range("E:E"))
If Not isct Is Nothing Then Call madate(isct)
End Sub
Sub copie(valeur)
Application.EnableEvents = False
If valeur <> "" And valeur.Column = 10 Then
With valeur.Parent.ListObjects("BASE_INCIDENTS")
Set zone = .ListRows(valeur.Row - .HeaderRowRange.Row).Range
End With
With Sheets("Archive").ListObjects("Tableau2")
Set l = .ListRows.Add
zone.Copy l.Range
End With
zone.Delete
End If
Application.EnableEvents = True
End Sub
Sub madate(isct)
Application.EnableEvents = False
For Each d In isct.Cells
If IsEmpty(d) Then
d.Offset(0, -3) = ""
Else
d.Offset(0, -3) = Format(Now, "mm/dd/yy")
End If
Next
For Each h In isct.Cells
If IsEmpty(h) Then
h.Offset(0, -2) = ""
Else
h.Offset(0, -2) = Format(Now, "hh:mm:ss")
End If
Next
Application.EnableEvents = True
End Sub