Bonjour,
Je bloque sur mon code et je tourne en ronds sans trouver l'issue :( "Erreur 438 propriété ou méthode non géré par cet objet"
Je souhaite copier une plage de 3 cellule suite à un filtre (jusque là ça marche) et coller dans un autre classeur sur la dernière ligne vide en colonne H à J.
Je précise que le tableau cible est en tableau structuré (nom "Tableau4")
Et voici mon code jusqu'à maintenant:
Sub Import_NewOrder()
Dim nblig As Integer, dlg As Integer
Dim dlg1 As Integer
Call EffacerTousLesFiltres
dlg = Range("C" & Rows.Count).End(xlUp).Row
dlg1 = Range("H" & Rows.Count).End(xlUp).Row + 1
With Workbooks("KITS_SPARES_AIB Carnet de commande v2 (+div + iti) CP 157 165").Sheets("Carnet de commande ")
.Activate
If WorksheetFunction.CountIf(.Range("CL10:CL3000"), "TO BE ADDED") >= 1 Then
nblig = WorksheetFunction.CountIf(.Range("CL10:CL" & dlg), "TO BE ADDED")
.Range("CL9:CL" & dlg).SpecialCells(xlCellTypeVisible).AutoFilter Field:=90, Criteria1:="TO BE ADDED"
.Range("BO9:BO" & dlg).SpecialCells(xlCellTypeVisible).AutoFilter Field:=67, Criteria1:="SPARES"
.Range("C10:E" & dlg).Copy
With Workbooks("LOB RECHANGES").Sheets("RECHANGES")
.Sheets("RECHANGES").Range("H3:J" & dlg1).PasteSpecial Paste:=xlPasteValues
End With
End If
End With
End Sub
Public Sub EffacerTousLesFiltres()
On Error Resume Next
Dim fc As Worksheet
For Each fc In Workbooks("KITS_SPARES_AIB Carnet de commande v2 (+div + iti) CP 157 165").Worksheets
If fc.FilterMode = True Then
fc.ShowAllData
End If
Next fc
End Sub
Merci d'avance