Ouvrir fichier excel via une boite de dialogue et copier des données vers un aut

Signaler
Messages postés
2
Date d'inscription
mercredi 17 mars 2010
Statut
Membre
Dernière intervention
19 mars 2010
-
Messages postés
2
Date d'inscription
mercredi 17 mars 2010
Statut
Membre
Dernière intervention
19 mars 2010
-
Bonjour,
je galère depuis 2 jours sur ma macro avec Excel.

je vous expose mon problème: j'ai des fichiers de données individuels et un fichiers global dans lequel je souhaite faire des suivis statistiques.
dans ce dernier, j'ai créer un bouton de commande affecté d'une macro, qui devrait permettre d'ouvrir les fichiers de données et de copier certaines données vers mon fichier de suivi.
Pour l'instant, j'ai réussi à faire apparaitre la fenetre d'ouverture de fichier, ouvrir le fichier, mais je n'arrive pas à faire en sorte que la macro stocke le nom du fichier comme variable afin que je puisse copier/coller les donnéees situées dans différents onglets. Voici la bête:

D'avance merci

Fred


Sub stat()
Rows("5:5").Select
Selection.Insert Shift:=xlDown
Rows("6:6").Select
Selection.Insert Shift:=xlDown
Rows("5:5").Select

strFichier = Application.GetOpenFilename("Nom fichier,*.xls")
Workbooks.Open strFichier

Windows("" & strFichier & ".xls").Activate


Range("B9:C9").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("B5").Select
Windows("" & strFichier & ".xls").Activate
Range("E9:F9").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("C5").Select
Windows("" & strFichier & ".xls").Activate
Range("I7:K7").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("D5").Select
Windows("" & strFichier & ".xls").Activate
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=21
Sheets("Veine").Select
Range("D14:D41").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
ActiveWindow.SmallScroll ToRight:=29
Range("AF5").Select
Windows("" & strFichier & ".xls").Activate
Range("I14:I41").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("AG5").Select
Application.CutCopyMode = False
Selection.Delete Shift:=xlToLeft
Range("AH5").Select
Selection.Delete Shift:=xlToLeft
Range("AI5").Select
Selection.Delete Shift:=xlToLeft
Range("AJ5").Select
Selection.Delete Shift:=xlToLeft
Range("AK5").Select
Selection.Delete Shift:=xlToLeft
Range("AL5").Select
Selection.Delete Shift:=xlToLeft
Range("AM5").Select
Selection.Delete Shift:=xlToLeft
Range("AN5").Select
Selection.Delete Shift:=xlToLeft
Range("AO5").Select
Selection.Delete Shift:=xlToLeft
Range("AP5").Select
Selection.Delete Shift:=xlToLeft
Range("AQ5").Select
Selection.Delete Shift:=xlToLeft
ActiveWindow.SmallScroll ToRight:=8
Range("AR5").Select
Selection.Delete Shift:=xlToLeft
Range("AS5").Select
Selection.Delete Shift:=xlToLeft
Range("AT5").Select
Windows("" & strFichier & ".xls").Activate
Sheets("Pales").Select
Range("G13:G21").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
ActiveWindow.SmallScroll ToRight:=13
Range("BC5").Select
Windows("" & strFichier & ".xls").Activate
Range("G23:G29").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("BJ5").Select
Windows("" & strFichier & ".xls").Activate
Range("G31:G37").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
ActiveWindow.SmallScroll ToRight:=17
Range("BQ5").Select
Windows("" & strFichier & ".xls").Activate
Range("G39:G41").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("BT5").Select
Windows("" & strFichier & ".xls").Activate
ActiveWindow.SmallScroll Down:=27
Range("G43:G45").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("BW5").Select
Windows("" & strFichier & ".xls").Activate
Range("G47:G55").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
ActiveWindow.SmallScroll ToRight:=14
Range("CF5").Select
Windows("" & strFichier & ".xls").Activate
Range("G57:G65").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("CO5").Select
Windows("" & strFichier & ".xls").Activate
ActiveWindow.ScrollWorkbookTabs Position:=xlFirst
Sheets("P1_S10_BF").Select
Range("K2:K4").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
ActiveWindow.SmallScroll ToRight:=11
Range("CP5").Select
Application.CutCopyMode = False
Selection.Cut Destination:=Range("CX5")
Range("CQ5").Select
Selection.Cut Destination:=Range("DG5")
Range("DG5").Select
Windows("" & strFichier & ".xls").Activate
Sheets("P1_S50_BF").Select
Range("K2:K4").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
ActiveWindow.Zoom = 85
ActiveWindow.Zoom = 70
ActiveWindow.SmallScroll Down:=-3
ActiveWindow.SmallScroll ToRight:=-11
Range("CP5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("CQ5").Select
Application.CutCopyMode = False
Selection.Cut Destination:=Range("CY5")
Range("CR5").Select
Selection.Cut Destination:=Range("DH5")
Range("CQ5").Select
Windows("" & strFichier & ".xls").Activate
Sheets("P1_S90_BF").Select
Range("K2:K4").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("CR5").Select
Application.CutCopyMode = False
Selection.Cut Destination:=Range("CZ5")
Range("CS5").Select
Selection.Cut Destination:=Range("DI5")
Range("DI5").Select
Windows("" & strFichier & ".xls").Activate
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
Sheets("P4_S10_BF").Select
Range("K2:K4").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
ActiveWindow.SmallScroll ToRight:=-3
Range("CR5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("CS5").Select
Application.CutCopyMode = False
Selection.Cut Destination:=Range("DA5")
Range("CT5").Select
Selection.Cut Destination:=Range("DJ5")
Range("CS5").Select
ActiveWindow.SmallScroll ToRight:=4
Windows("" & strFichier & ".xls").Activate
Sheets("P4_S50_BF").Select
Range("K2:K4").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("CT5").Select
Application.CutCopyMode = False
Selection.Cut Destination:=Range("DB5")
Range("CU5").Select
Selection.Cut Destination:=Range("DK5")
Range("DK5").Select
Windows("" & strFichier & ".xls").Activate
Sheets("P4_S90_BF").Select
Range("K2:K4").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Range("CT5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("CU5").Select
Application.CutCopyMode = False
Selection.Cut Destination:=Range("DC5")
Range("CV5").Select
Selection.Cut Destination:=Range("DL5")
Range("DL5").Select
Windows("" & strFichier & ".xls").Activate
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
ActiveWindow.ScrollWorkbookTabs Sheets:=1
Sheets("P8_S10_BF").Select
Range("K2:K4").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Range("CU5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("CV5").Select
Application.CutCopyMode = False
Selection.Cut Destination:=Range("DD5")
Range("CW5").Select
Selection.Cut Destination:=Range("DM5")
Range("DM5").Select
Windows("" & strFichier & ".xls").Activate
Sheets("P8_S50_BF").Select
Range("K2:K4").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Range("CV6").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("CW6").Select
Application.CutCopyMode = False
Selection.Cut Destination:=Range("DE5")
Range("CX6").Select
Selection.Cut Destination:=Range("DN5")
Range("CV6").Select
Selection.Cut Destination:=Range("CV5")
Range("CW6").Select
Windows("" & strFichier & ".xls").Activate
Sheets("P8_S90_BF").Select
Range("K2:K4").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("CW6").Select
Application.CutCopyMode = False
Selection.Cut Destination:=Range("CW5")
Range("CX6").Select
Selection.Cut Destination:=Range("DF5")
Range("CY6").Select
Selection.Cut Destination:=Range("DO5")
Range("DO5").Select
ActiveWindow.SmallScroll ToRight:=18
Windows("" & strFichier & ".xls").Activate
Sheets("Usinage").Select
Range("G13:G15").Select
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Range("DP5").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("DS5").Select
Windows("" & strFichier & ".xls").Activate
Range("G17:G19").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("DV5").Select
Windows("" & strFichier & ".xls").Activate
Range("G21:G23").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("DY5").Select
Windows("" & strFichier & ".xls").Activate
Range("G25:G27").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("EB5").Select
Windows("" & strFichier & ".xls").Activate
Range("G29:G31").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("EE5").Select
Windows("" & strFichier & ".xls").Activate
Range("G33:G35").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=True
Range("EH5").Select
Windows("" & strFichier & ".xls").Activate
Range("G37").Select
Application.CutCopyMode = False
Selection.Copy
Windows("MASTER SUIVI STAT rd3.xls").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Windows("" & strFichier & ".xls").Activate
Windows("MASTER SUIVI STAT rd3.xls").Activate

Rows("6:6").Select
Selection.Delete
Range("ei5:iv5").Select
Selection.Delete
Range("A5").Select
Range("A5").Select
Windows("" & strFichier & ".xls").Close







Sheets("Valeurs").Select
Range("D5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("A2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("H5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("L5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("P5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("T5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("X5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AB5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("E5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("B2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("I5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("M5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("Q5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("U5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("Y5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AC5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("F5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("C2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("J5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("N5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("R5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("V5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("Z5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AD5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("G5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("D2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("K5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("O5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("S5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("W5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AA5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AE5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AF5:AG5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("E2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AH5:AI5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AJ5:AK5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AL5:AM5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AN5:AO5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AP5:AQ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AR5:AS5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AT5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("G2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AW5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AZ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AU5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("H2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AX5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BA5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AV5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("I2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("AY5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BB5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BC5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("J2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BD5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BE5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BF5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BG5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BH5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BI5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BJ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("K2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BK5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BL5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BM5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BN5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BO5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BP5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BQ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("L2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BR5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BS5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BT5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("M2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BU5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BV5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BW5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("N2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BZ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CC5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BX5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("O2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CA5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CD5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("BY5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("P2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CB5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CE5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CF5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("Q2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CI5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CL5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CG5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("R2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CJ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CM5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CH5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("S2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CK5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CN5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CO5").Select
Selection.Copy
Sheets("Valeurs (2)").Select

Range("T2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CR5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CU5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CP5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("U2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CS5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CV5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CQ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("V2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CT5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CW5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CX5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("W2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DA5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DD5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CY5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("X2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DB5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DE5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("CZ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("Y2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DC5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DF5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DG5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("Z2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DJ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DM5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DH5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("AA2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DK5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DN5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DI5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("AB2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DL5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DO5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DP5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("AC2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DQ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DR5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DS5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("AD2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DT5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DU5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DV5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("AE2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DW5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DX5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DY5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("AF2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("DZ5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("EA5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("EB5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("AG2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("EC5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("ED5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown


Sheets("Valeurs").Select
Range("EE5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("AH2").Select

Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("EF5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown

Sheets("Valeurs").Select
Range("EG5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select
Selection.Insert Shift:=xlDown


Sheets("Valeurs").Select
Range("EH5").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Valeurs (2)").Select

Range("AI2").Select

Selection.Insert Shift:=xlDown

Range("A2").Select
Application.CutCopyMode = False
Sheets("Valeurs").Select
Range("A5").Select


End Sub

1 réponse

Messages postés
2
Date d'inscription
mercredi 17 mars 2010
Statut
Membre
Dernière intervention
19 mars 2010

Bonjour,
j'ai finalement finie par trouver la solution:


...
fichier_source = Application.GetOpenFilename("Excel Files (*.xls), *.xls", , "Fichier source")
Application.Workbooks.Open Filename:=fichier_source
fichier_source = ActiveWorkbook.Name

Windows(fichier_source).Activate
...

Bye
Fred