Option Explicit
Sub genCompta()
Dim lcJournal As Range
Dim rJournal As Range
Dim rCompta As Range
Dim rowsjournal As Range
With fJournal
Set lcJournal = .UsedRange.SpecialCells(xlCellTypeLastCell)
Set rowsjournal = .Range(.[A2], lcJournal).Rows
fCompta.Cells.Clear
End With
Set rCompta = fCompta.[A1:F1]
rCompta.Cells(1, "A") = "date"
rCompta.Cells(1, "B") = "compte"
rCompta.Cells(1, "C") = "libellé"
rCompta.Cells(1, "D") = "montant débit"
rCompta.Cells(1, "E") = "montant crédit"
rCompta.Cells(1, "F") = "Pièce"
Set rCompta = rCompta.Offset(1, 0)
For Each rJournal In rowsjournal
rCompta.Cells(1, "A") = rJournal.Cells(1, "B") 'Date
rCompta.Cells(1, "B") = fJournal.[D1] 'Compte
rCompta.Cells(1, "C") = rJournal.Cells(1, "C") 'Libellé
rCompta.Cells(1, "D") = rJournal.Cells(1, "D") 'Montant débit
rCompta.Cells(1, "E") = "" 'Montant crédit
rCompta.Cells(1, "F") = rJournal.Cells(1, "A") 'Pièce
Set rCompta = rCompta.Offset(1, 0)
rCompta.Cells(1, "A") = rJournal.Cells(1, "B") 'Date
rCompta.Cells(1, "B") = fJournal.[E1] 'Compte
rCompta.Cells(1, "C") = rJournal.Cells(1, "C") 'Libellé
rCompta.Cells(1, "D") = "" 'Montant débit
rCompta.Cells(1, "E") = rJournal.Cells(1, "E") 'Montant crédit Ventes HT France
rCompta.Cells(1, "F") = rJournal.Cells(1, "A") 'Pièce
Set rCompta = rCompta.Offset(1, 0)
rCompta.Cells(1, "A") = rJournal.Cells(1, "B") 'Date
rCompta.Cells(1, "B") = fJournal.[F1] 'Compte
rCompta.Cells(1, "C") = rJournal.Cells(1, "C") 'Libellé
rCompta.Cells(1, "D") = "" 'Montant débit
rCompta.Cells(1, "E") = rJournal.Cells(1, "F") 'Montant crédit Ventes HT Export
rCompta.Cells(1, "F") = rJournal.Cells(1, "A") 'Pièce
Set rCompta = rCompta.Offset(1, 0)
rCompta.Cells(1, "A") = rJournal.Cells(1, "B") 'Date
rCompta.Cells(1, "B") = fJournal.[G1] 'Compte
rCompta.Cells(1, "C") = rJournal.Cells(1, "C") 'Libellé
rCompta.Cells(1, "D") = "" 'Montant débit
rCompta.Cells(1, "E") = rJournal.Cells(1, "G") 'Montant crédit Compte TVA
rCompta.Cells(1, "F") = rJournal.Cells(1, "A") 'Pièce
Set rCompta = rCompta.Offset(1, 0)
Next rJournal
End Sub