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 30 31
| Sub copier_commentaires()
Set xlbookbesoin = Application.ActiveWorkbook
filetoopen = Application _
.GetOpenFilename("Fichier Excel (*.xls), *.xls", , "Selectionner le tableau des Commentaire")
If filetoopen <> False Then
Set xlbook = Application.Workbooks.Open(filetoopen)
For x = 20 To 100 Step 7
Set xlbook = Application.Workbooks.Open(filetoopen)
ActiveWorkbook.Sheets("Sommaire").Range("I" & x).Copy
xlbookbesoin.Activate
ActiveWorkbook.Sheets("Sommaire").Visible = True
ActiveWorkbook.Sheets("Sommaire").Select
ActiveSheet.Range("I20").Select
Selection.PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
ActiveWorkbook.Save
xlbook.Close
End If
Application.DisplayAlerts = True
ActiveSheet.DisplayAutomaticPageBreaks = False
Application.ScreenUpdating = True
End Sub |
Partager