Re : code sous excel 2003,mais ne fonctionne pas sous excel 2000
Bonsoir,
Apres,essai cela ne fonctionne pas,et le verrouillage des cellules n'est pas operationnel.Comment s'en sortir?
voici le code en entier.
Merci de votre aide.
laplayast.
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
If ActiveSheet.Index < Sh.Index Then Exit Sub
On Error Resume Next
If Sh.Cells.SpecialCells(xlCellTypeAllFormatConditions).Count = 0 Then Exit Sub
If Err.Number <> 0 Then Exit Sub
On Error GoTo 0
With Application
.EnableEvents = False
If .CountA(Sh.Cells.SpecialCells(xlCellTypeAllFormatConditions)) <> _
Sh.Cells.SpecialCells(xlCellTypeAllFormatConditions).Count Then
Sh.Activate
MsgBox "Faut tout remplir, mon gars!"
End If
.EnableEvents = True
End With
End Sub
Private Sub Workbook_Open()
For Each Sh In Sheets
Sh.Protect userInterfaceOnly:=True
Next Sh
With Sheets("voiture")
.Unprotect Password:="toto"
.Cells.Locked = True
.Range("B4:B5,B8,B25:B46,B56,C31,D4,D8,D11😀16,D20,D22,D29😀30,D34,D41😀43,D49,D51,D53,E11:E12,F4,F11:F12,F22,F29:F30,F34,F43,F56,G25:G46,G49,G51,G53").Locked = False
.Protect Password:="toto"
End With
With Sheets("fleur")
.Unprotect Password:="toto"
.Cells.Locked = True
.Range("B3:B4,B8,B24:B44,B64:B73,C20,C56:C57,C59:C61,D3,D8,D11😀16,D32😀33,D66😀73,E11:E12,E15:E16,E34:E36,E38:E39,E42,E47,E49,E51,E57,E59:E61,F3,F11,F18,F20,F33,F66:F73,G34:G36,G38:G39,G42,H24:H44,H47,H49,H51,H54:H61,H64:H73").Locked = False
.Protect Password:="toto"
End With
With Sheets("poire")
.Unprotect Password:="toto"
.Cells.Locked = True
.Range("B3:B4,B9:B10,B12:B13,B15:B18,C9:C10,C12:C13,C15:C18,D3,E10,E12:E13,F3,F9:F10,F12:F13,F15:F18").Locked = False
.Protect Password:="toto"
End With
End Sub