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
| Sub Choix_du_Fichier()
Dim FichierSource As Variant
Dim Source As Workbook
Dim Cible As Worksheet
On Error GoTo Fin
Set Cible = Sheets("Fin de Travaux réalisés")
FichierSource = Application.GetOpenFilename("Fichiers (*.xlsx),*.xlsx")
If FichierSource = False Then GoTo Fin
Application.ScreenUpdating = False
Set Source = Workbooks.Open(FichierSource)
With Source
.Sheets("Fin de Travaux réalisés").Range("C15:D800,M15:M800").Copy Destination:=Cible.Range("A1")
.Close False
End With
Application.ScreenUpdating = True
MsgBox "Fin de l'import !"
GoTo Fin
Fin:
Application.ScreenUpdating = True
Set Cible = Nothing
Set Source = Nothing
End Sub |
Partager