Clôturer un fichier selon condition

Bonjour a vous tous,

En cette période compliquée, je me permet de faire appel a vos compétences.

La macro fonctionne très bien et j'aurai voulu ajouté une condition.

1 condition "L5 = Résolu" OK

2 Condition "Saisir mot de passe " ok

et la 3 condition que je souhaite intégré après la saisie du mot de passe que la cellule L5 passe en valeur "Clôturer" .

Par avance , merci

Sub cloturer()

If ActiveSheet.Name = "OT-VIERGE" Then

MsgBox ("Vous ne pouvez pas clôturer Signalement PCC.xlsm"): Exit Sub

End If

question = InputBox("Merci de saisir le mot de passe", , , 1000, 3000)

If question <> "toto" Then MsgBox "Fermeture non autorisée": Exit Sub

a = Range("L5")

If Range("L5").Value <> "Résolu" Then

MsgBox ("Clôture impossible, la cellule L5 n'est pas à jour"): Exit Sub

End If

rep2 = Workbooks("TABLEAU-OT.xlsm").Path & "\"

Workbooks.Open rep2 & "LOG.xlsm"

Windows("LOG.xlsm").Activate

Set celluletrouvee = Workbooks("LOG.xlsm").Sheets("Feuil1").Range("A1:A999").Find(Left(nom, 5), lookat:=xlWhole)

If celluletrouvee Is Nothing Then GoTo suite

derligne = celluletrouvee.Offset(0, 1)

Sheets("Feuil1").Range("A" & derligne & ":B" & derligne).Delete

ActiveWorkbook.Save

suite:

Application.DisplayAlerts = False

ActiveWorkbook.Close

a = ligne

If Range("A1:P5000").Locked = True Then GoTo suite Else Range("A1:P5000").Locked = True

Selection.Locked = True

Selection.FormulaHidden = False

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

ligne = Workbooks("TABLEAU-OT.xlsm").Worksheets("Synthèse").Cells(1, 27)

' ActiveWorksheet.Protect userinterfaceonly:=True, Password:="chalet53"

Workbooks("TABLEAU-OT.xlsm").Worksheets("Synthèse").Cells(ligne, 12) = Range("L5").Value

ActiveWorkbook.Save

Application.DisplayAlerts = False

ThisWorkbook.Close

Application.DisplayAlerts = True

Rechercher des sujets similaires à "cloturer fichier condition"