Bonjour à tous ;
J'aurai besoin de votre expertise pour réaliser une macro Excel
Je dois répéter ma macro sur 350 lignes, savez vous quelle code mettre pour que ma macro en automatique aille chercher ligne par ligne ?
Voici mon code macro:
Sub Macrotesttemplate()
'
' Macrotesttemplate Macro
'
'
Range("A2").Select
Selection.Copy
Sheets("TEMPLATE 1").Select
ActiveWindow.SmallScroll Down:=9
Range("B22").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B23").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("C2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
ActiveWindow.SmallScroll Down:=-21
Range("B3").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("D2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B8").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("E2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B11").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("F2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B10").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
Range("G2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B4").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("H2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B7").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Sheets("TEMPLATE 1").Select
Application.CutCopyMode = False
Sheets("TEMPLATE 1").Copy After:=Sheets(2)
Sheets("Sheet1").Select
Range("A3").Select
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
ActiveWindow.SmallScroll Down:=9
Range("B22").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("B3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B23").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=-21
Sheets("Sheet1").Select
Range("C3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B3").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("D3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B8").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("E3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B11").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("F3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B10").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("G3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B4").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("H3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B7").Select
ActiveSheet.Paste
End Sub
Merci à tous !
J'aurai besoin de votre expertise pour réaliser une macro Excel
Je dois répéter ma macro sur 350 lignes, savez vous quelle code mettre pour que ma macro en automatique aille chercher ligne par ligne ?
Voici mon code macro:
Sub Macrotesttemplate()
'
' Macrotesttemplate Macro
'
'
Range("A2").Select
Selection.Copy
Sheets("TEMPLATE 1").Select
ActiveWindow.SmallScroll Down:=9
Range("B22").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("B2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B23").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("C2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
ActiveWindow.SmallScroll Down:=-21
Range("B3").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("D2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B8").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("E2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B11").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("F2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B10").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
Range("G2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B4").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("H2").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1").Select
Range("B7").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Sheets("TEMPLATE 1").Select
Application.CutCopyMode = False
Sheets("TEMPLATE 1").Copy After:=Sheets(2)
Sheets("Sheet1").Select
Range("A3").Select
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
ActiveWindow.SmallScroll Down:=9
Range("B22").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("B3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B23").Select
ActiveSheet.Paste
ActiveWindow.SmallScroll Down:=-21
Sheets("Sheet1").Select
Range("C3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B3").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("D3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B8").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("E3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B11").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("F3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B10").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("G3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B4").Select
ActiveSheet.Paste
Sheets("Sheet1").Select
Range("H3").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("TEMPLATE 1 (2)").Select
Range("B7").Select
ActiveSheet.Paste
End Sub
Merci à tous !