Bonjour,
Voilà, ma requête est toute simple. Je souhaite copier un certain nombre de tableaux provenant de mon fichier Excel vers un nouveau fichier Word. Ici, aucun problème.
Par contre, je voudrais séparer chacun de mes tableaux d'au moins un saut de ligne (soit l'équivalent du "Entrée" sur un clavier) pour éviter que tous mes tableaux soient collés. Je voudrais aussi que chacun des tableaux Excel qui s'ajoutent s'ajustent automatiquement à mes marges.
De mon côté, voici ce que j'ai réussi à faire jusqu'à maintenant.
Merci encore 1000 fois pour votre aide!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29 Dim WordApp As Word.Application Dim WordDoc As Word.Document Dim NombreA14 As Double Dim NombreA10 As Double NombreA14 = Range("A14") NombreA10 = Range("A10") Application.ScreenUpdating = False Set AppWord = New Word.Application AppWord.Visible = True AppWord.Documents.Add For i = 1 To NombreA10 Range("B" & i * NombreA14 & ":Q" & i * NombreA14 + 4).Copy With AppWord.Selection .Paste .WholeStory With .Font End With .HomeKey Unit:=wdStory End With Application.ScreenUpdating = True Application.CutCopyMode = False Next i
Partager