Macro récupération de plusieurs onglet à la suite les uns des autres

Fermé
caroouline Messages postés 35 Date d'inscription mardi 5 mai 2020 Statut Membre Dernière intervention 15 février 2024 - 11 mai 2020 à 12:47
cs_Le Pivert Messages postés 7903 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 11 mars 2024 - 11 mai 2020 à 13:36
Bonjour,

J'aimerais récupérer le premier onglet et le copier sur le troisiéme.
Ensuite j'aimerais récupérer le deuxiéme et le coller en dessous du premier onglet qui a été coller sur le troisiéme.
Cependant tous les mois changent et il y a plus de lignes certaines fois.

Mon VBA concernant le deuxiéme onglet récupére les nouvelles lignes s'il y a mais pas pour mon premier.

Pourriez-vous m'indiquez qu'est ce qu'il faut modifier sur mon vba?

Voici mon VBA :

Sub Importation()
'
' Importation Macro
'

'
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("CAF-CFACT").Select
Selection.End(xlUp).Select
Range("A3").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range("A3:M3").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Import").Select
Selection.End(xlUp).Select
Selection.End(xlToLeft).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Selection.End(xlDown).Select
Range("A3").Select
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("CCV-512900").Select
Selection.End(xlUp).Select
Range("A3").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlToRight)).Select
Range("A3:N3").Select
Range(Selection, Selection.End(xlDown)).Select
Application.CutCopyMode = False
Selection.Copy
ActiveWindow.ScrollWorkbookTabs Position:=xlLast
Sheets("Import").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End Sub
A voir également:

1 réponse

cs_Le Pivert Messages postés 7903 Date d'inscription jeudi 13 septembre 2007 Statut Contributeur Dernière intervention 11 mars 2024 728
11 mai 2020 à 13:36
Bonjour,

As-tu réussie avec ces explications?

https://forums.commentcamarche.net/forum/affich-36635080-integrer-lignes-sur-plusieurs-onglets-les-unes-apres-les-autres-excel-2010#1

Car c'est la même chose que tu demandes!
0