Bonjour M xorsankukai.
J'ai du mal à modifier pour faire le schéma inverse
S'il te plait un dernier coup de main pour cette dernière partie
c’est-à-dire :
OJECTIF: si AB >= 1 COPIER de 'AJ' à 'AN' Coller de 'M' à 'Q' et
COPIER de 'AO' Coller de 'V' et COPIER de 'AP' Coller de 'AP'
La copie se fait entre le tableau4849 Feuille (HISTORQUE) et le Tableau47 Feuille ( Feuil2)
Cordialement...
J'ai commencé à modifier le code ci-dessous mais je suis resté là je ne comprends pas la suite de la macro.
J’ai joint le fichier à jour.
Sub copyyy()
Dim tb, Newtb(), i&, k&, j, rcell As Range
With Sheets("HISTORQUE")
If Not .ListObjects(1).DataBodyRange Is Nothing Then
tb = .ListObjects(1).DataBodyRange
k = 0
ReDim Newtb(0 To UBound(tb, 1), 1 To 8)
For i = 1 To UBound(tb, 1)
If tb(i, 42) Like "NEGATIF" Then
Newtb(k, 1) = tb(i, 1)
For j = 36 To 43
Newtb(k, j - 80) = tb(i, j): Next j
k = k + 1
End If
Next i
End If
End With
If k > 0 Then
With Sheets("Feuil2").ListObjects(1)
If .InsertRowRange Is Nothing Then
Set rcell = .HeaderRowRange.Cells(1).Offset(.ListRows.Count + 1)
Else
Set rcell = .InsertRowRange.Cells(1)
End If
End With
Application.DisplayAlerts = False
rcell.Resize(k, 35).Value = Newtb
Application.DisplayAlerts = True
Mégot "Données enregistrées", vbInformation
Else
MsgBox "Aucunes données à transférer", vbExclamation
End If
Erase tb: Erase Newtb: Set rcell = Nothing
End Sub