Private Sub SauVe_Clik_Click()
Dim Nomfeuille As String, Entree As String
Dim f As Worksheet 'déclare la variable f
Début:
Entree = InputBox("Saisissez le nom du rapport journalier shouaitez que vous voulez dans ce fomat ci : 010106 ")
For Each f In Sheets
If UCase(f.Name) = UCase(Entree) Or UCase(f.Name) = _
UCase(Left(Entree, 2) & "." & Mid(Entree, 3, 2) & "." & Right(Entree, 2)) Then 'accepte les MAJUSCULES/minuscules comme identiques
MsgBox "Ce Rapport Journalier Existe deja Veuillez recommencez l'operation sous un nom different Merci "
GoTo Début:
End If
Next f
If Len(Entree) = 6 Then
Nomfeuille = Left(Entree, 2) & "." & Mid(Entree, 3, 2) & "." & Right(Entree, 2)
'If Nomfeuille <>
Sheets("Base").Copy Before:=Worksheets(1) 'ou after:=Worksheets(Worksheets.count)
ActiveSheet.Name = Nomfeuille
Msg = "Votre Feuille heures a été sauvegardé sous le nom que lui avez donnez."
Title = "Sauvegarde du rapport journalier"
Style = vbOKOnly + vbInformation
Reponse = MsgBox(Msg, Style, Title)
End If
End Sub