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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| Private Sub Worksheet_beforedoubleclick(ByVal Target As Range, cancel As Boolean)
Dim wbMyWb As Workbook
Dim Nom_Fichier As Variant
Application.ScreenUpdating = False
If ActiveCell.Address <> "$B$2" Then Exit Sub
Nom_Fichier = Application.GetOpenFilename("Fichiers Excel (*.xlsm,")
If Nom_Fichier <> False Then
Set wbMyWb = Workbooks.Open(Nom_Fichier)
wbMyWb.Activate
End If
Dligne = Range("B50000").End(xlUp).Row
Workbooks.Open (Nom_Fichier)
Sheets("Feuil1").Cells(4, 2).Copy
Cells(Dligne + 1, 1).PasteSpecial
Sheets("Feuil1").Cells(5, 2).Copy
Cells(Dligne + 1, 5).PasteSpecial
Sheets("Feuil1").Cells(6, 2).Copy
Cells(Dligne + 1, 4).PasteSpecial
Sheets("Feuil1").Cells(8, 2).Copy
Cells(Dligne + 1, 2).PasteSpecial
Sheets("Feuil1").Cells(9, 2).Copy
Cells(Dligne + 1, 8).PasteSpecial
Sheets("Feuil1").Cells(10, 2).Copy
Cells(Dligne + 1, 6).PasteSpecial
Sheets("Feuil1").Cells(11, 2).Copy
Cells(Dligne + 1, 7).PasteSpecial
Sheets("Feuil1").Cells(12, 2).Copy
Cells(Dligne + 1, 3).PasteSpecial
Workbooks(Nom_Fichier).Close
Application.ScreenUpdating = True
End Sub |
Partager