TEMAGOULTFARID
XLDnaute Occasionnel
bonjour,
j'ai un problème de Bug sur une macro et j'aurai besoin de vos lumière.
par avance merci
Sub cloturer()
If ActiveSheet.Name = "OT-VIERGE" Then
MsgBox ("Vous ne pouvez pas clôturer Le fichier.xlsm"): Exit Sub
End If
question = InputBox("Merci de saisir le mot de passe", , , 1000, 3000)
If question <> "chalet53" 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
a = ligne
If Range("A6:L200").Locked = True Then GoTo suite Else Range("A6:L200").Locked = True
Selection.Locked = True
Selection.FormulaHidden = False
suite:
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, 9) = Range("L5").Value
ActiveWorkbook.Save
Application.DisplayAlerts = False
ThisWorkbook.Close
Application.DisplayAlerts = True
End Sub
j'ai un problème de Bug sur une macro et j'aurai besoin de vos lumière.
par avance merci
Sub cloturer()
If ActiveSheet.Name = "OT-VIERGE" Then
MsgBox ("Vous ne pouvez pas clôturer Le fichier.xlsm"): Exit Sub
End If
question = InputBox("Merci de saisir le mot de passe", , , 1000, 3000)
If question <> "chalet53" 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
a = ligne
If Range("A6:L200").Locked = True Then GoTo suite Else Range("A6:L200").Locked = True
Selection.Locked = True
Selection.FormulaHidden = False
suite:
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, 9) = Range("L5").Value
ActiveWorkbook.Save
Application.DisplayAlerts = False
ThisWorkbook.Close
Application.DisplayAlerts = True
End Sub