Date | N° compte | Intitulé | TTC | TVA | HT |
03.01.20 | 627000 | PrlV Cotis Compte à composer | 2,14 |
N° compte | Intitulé | Débit | Crédit | |
03.01.20 | 627000 | PrlV Cotis Compte à composer | 2,14 | |
03.01.20 | 512000 | PrlV Cotis Compte à composer | 2,14 |
Date | N° compte | Intitulé | TTC | TVA | HT |
03.01.20 | 626100 | PayPal pour OVH | 50,62 | 8,44 | 42,18 |
Date | N° compte | Intitulé | Débit | Crédit |
03.01.20 | 626100 | PayPal pour OVH | 42,18 | |
03.01.20 | 445660 | PayPal pour OVH | 8,44 | |
03.01.20 | 512000 | PayPal pour OVH | 50,62 |
Jour | Code | Intitulé | Débit | Crédit |
1 | 123 | HHH | 666 | |
2 | 434 | GGG | 777 | |
6 | 422 | FFF | 888 |
Je te remercie, je vais y prêter attention !Bonjour
Les posts #13 et #14 donnent une solution par rapport au tableau initial très proche du tiens...
Option Explicit: Option Base 1
Sub Essai()
If ActiveSheet.Name <> "Feuil1" Then Exit Sub
Dim n&: n = Cells(Rows.Count, 1).End(3).Row: If n = 1 Then Exit Sub
Dim T01, T02, k As Byte, i&, j&
n = n - 1: T01 = [A2].Resize(n, 5): i = 2 * n: ReDim T02(5, i): j = 1
For i = 1 To n
For k = 1 To 5: T02(k, j) = T01(i, k): Next k: j = j + 1
For k = 1 To 3: T02(k, j) = T01(i, k): Next k
T02(4, j) = T01(i, 5): T02(5, j) = T01(i, 4): j = j + 1
Next i
Application.ScreenUpdating = 0: Worksheets("Feuil2").Select: Columns("A:E").ClearContents
[A1] = "Jour": [B1] = "Code": [C1] = "Intitulé": [D1] = "Débit": [E1] = "Crédit"
j = j - 1: [A2].Resize(j, 5) = Application.Transpose(T02)
End Sub
Option Explicit: Option Base 1
Sub Essai()
If ActiveSheet.Name <> "Feuil1" Then Exit Sub
Dim n&: n = Cells(Rows.Count, 1).End(3).Row: If n = 1 Then Exit Sub
Dim T01, T02, k As Byte, i&, j&
n = n - 1: T01 = [A2].Resize(n, 7).Value2: i = 2 * n: ReDim T02(7, i): j = 1
For i = 1 To n
For k = 1 To 7: T02(k, j) = T01(i, k): Next k: j = j + 1
For k = 1 To 5: T02(k, j) = T01(i, k): Next k
T02(6, j) = T01(i, 7): T02(7, j) = T01(i, 6)
T02(3, j) = "512000": T02(4, j) = Empty: j = j + 1
Next i
Application.ScreenUpdating = 0: Worksheets("Feuil2").Select: Columns("A:G").ClearContents
[A1] = "Jour": [B1] = "Référence": [C1] = "N° compte": [D1] = "N° tiers"
[E1] = "Libellé écriture": [F1] = "Débit": [G1] = "Crédit"
j = j - 1: [A2].Resize(j, 7) = Application.Transpose(T02)
End Sub