Salut,
j'ai écrit un bout de code qui doit pouvoir t'aider :
Dim DocWord As Word.Document
Dim AppWord As Word.Application
Sub test()
Dim debut As Long, fin As Long
debut = 2: fin = 2
Set AppWord = New Word.Application
Application.DisplayAlerts = True
AppWord.ShowMe
AppWord.Visible = True
If Range("G" & Rows.Count).End(xlUp).Row > 1 Then
For ligne = 2 To Range("G" & Rows.Count).End(xlUp).Row
If Not Cells(ligne, 7).Value = Cells(ligne + 1, 7).Value Then
Call copie(debut, fin)
debut = ligne + 1
End If
fin = fin + 1
Next
End If
' Fin de conversation
AppWord.Application.Quit
Set AppWord = Nothing
End Sub
Private Sub copie(ByVal debut As Long, ByVal fin As Long)
Dim nomFichier As String
Set DocWord = AppWord.Documents.Add(, , wdNewBlankDocument, False)
ThisWorkbook.Worksheets("Feuil1").Range(debut & ":" & fin).Copy
DocWord.Range.PasteSpecial
nomFichier = Replace(Cells(debut, 7).Value, " ", "_") & "_" & Replace(Date, "/", "-") & "_$" & Cells(debut, 9).Value & "_" & Cells(1, 9).Value & ".doc"
DocWord.SaveAs ThisWorkbook.Path & "\" & nomFichier
DocWord.Close False
Set DocWord = Nothing
End Sub
Pour que ça marche il faut que tu trie ton tableau sur la colonne G auparavant, il te reste également à adapter la mise en forme dans word.
Le code marche mal mais l'idée est là.
Bon courage