Sub CommandButton1_Click()
Application.Calculation = xlManual
Application.ScreenUpdating = False
Sheets("ABCMB Export").Cells.ClearContents
Sheets("dcoll").Cells.ClearContents
'Last cell in column
Dim WS As Worksheet
Dim LastCell As Range
Dim LastCellRowNumber As Long
Set WS = Worksheets("ABCMB Export")
With WS
Set LastCell = .Cells(.Rows.Count, "C").End(xlUp)
LastCellRowNumber = LastCell.Row + 1
End With
Dim wb As Workbook, wb2 As Workbook
Dim vFile As Variant
'Set source workbook
Set wb = ActiveWorkbook
'Ouvre le fichier correspondant
vFile = Application.GetOpenFilename("Excel-files,*.xlsx", _
1, "Sélectionner le fichier à extraire", , False)
'Si l'utilisateur n'a rien saisi,fin
If TypeName(vFile) = "Boolean" Then Exit Sub
Workbooks.Open vFile
'saisi du nouveau fichier
Set wb2 = ActiveWorkbook
'selectionne les cellules que l'on veut copier
wb2.Worksheets("ABCMB Export").UsedRange.Copy 'ici j'avais Range("A1:S400")
'retour à l'original
wb.Activate
'Copie a partir de la derniere ligne
wb.Worksheets("ABCMB Export").Range("A").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
wb2.Save
wb2.Close
Application.ScreenUpdating = True
End Sub