Sub IMPORTbis()
Const LA_FEUILLE As String = "Activités"
Dim Sh As Worksheet, i&
Dim nom$, WBKSource As Workbook
Application.DisplayAlerts = False
Application.DisplayAlerts = True
With Application.FileDialog(msoFileDialogOpen)
.Title = "Choisissez le fichier à analyser"
.Filters.Clear
.Filters.Add "Fichier Excel", "*.xls*"
.AllowMultiSelect = False
If .Show <> 0 Then
nom = .SelectedItems(1)
Set WBKSource = Workbooks.Open(nom)
With WBKSource
i = 0
For Each Sh In .Worksheets
If LA_FEUILLE = Sh.Name Then
i = i + 1
End If
Next Sh
If i >= 1 Then
MsgBox "Cette feuille existe déjà", vbCritical, "ATTENTION"
.Close False
Exit Sub
Else
.Sheets("Activités").Copy Before:=ThisWorkbook.Sheets(1)
.Close False
End If
End With
Else
MsgBox "Aucun fichier n'a été sélectionné", , "Erreur": Exit Sub
End If
End With
Application.DisplayAlerts = True
'remettre ici la suite de ton code
End Sub