Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
papou
Bonjour Sortie du four sans trop de tests :
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column > 1 Then Exit Sub If Target.Value = "" Then Exit Sub If Target.Cells.Count > 1 Then Exit Sub On Error GoTo YaUnOs Select Case Month(Target.Value) Case Is > Month(today) Exit Sub Case Is < Month(today) End Select If Target.Locked = False Then Me.Unprotect "toto" Range("A" & Target.Row & ":F" & Target.Row).Locked = True Me.Protect "toto" End If Exit Sub
YaUnOs: MsgBox "erreur dans la saisie des dates sur la colonne A", vbInformation, "Arrêt" Exit Sub
End Sub
Cordialement Pascal
"Cath" a écrit dans le message de news:
Bonjour,
Je me suis promené sur tout le forum mais je n'ai pas réussi à trouver une solution à mon problème.
J'ai une colonne A qui est des dates jj/mm/aa Si cette date est inférieur au mois en cours je dois vérouiller la ligne de A à F.
voilà d'ou je pars, merci de votre aide sachant que j'ai la version Excel 2000
Private Sub Worksheet_Change(ByVal zz As Range)
If zz.Locked = False Then ActiveSheet.Unprotect "toto" zz.Locked = True ActiveSheet.Protect "toto" End If
End Sub
Bonjour
Sortie du four sans trop de tests :
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column > 1 Then Exit Sub
If Target.Value = "" Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo YaUnOs
Select Case Month(Target.Value)
Case Is > Month(today)
Exit Sub
Case Is < Month(today)
End Select
If Target.Locked = False Then
Me.Unprotect "toto"
Range("A" & Target.Row & ":F" & Target.Row).Locked = True
Me.Protect "toto"
End If
Exit Sub
YaUnOs:
MsgBox "erreur dans la saisie des dates sur la colonne A", vbInformation,
"Arrêt"
Exit Sub
End Sub
Cordialement
Pascal
"Cath" <Cath@discussions.microsoft.com> a écrit dans le message de news:
4B1C79CA-A1FA-4E17-BFE9-9C1D65F6E6EB@microsoft.com...
Bonjour,
Je me suis promené sur tout le forum mais je n'ai pas réussi à trouver une
solution à mon problème.
J'ai une colonne A qui est des dates jj/mm/aa
Si cette date est inférieur au mois en cours je dois vérouiller la ligne
de
A à F.
voilà d'ou je pars, merci de votre aide sachant que j'ai la version Excel
2000
Private Sub Worksheet_Change(ByVal zz As Range)
If zz.Locked = False Then
ActiveSheet.Unprotect "toto"
zz.Locked = True
ActiveSheet.Protect "toto"
End If
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column > 1 Then Exit Sub If Target.Value = "" Then Exit Sub If Target.Cells.Count > 1 Then Exit Sub On Error GoTo YaUnOs Select Case Month(Target.Value) Case Is > Month(today) Exit Sub Case Is < Month(today) End Select If Target.Locked = False Then Me.Unprotect "toto" Range("A" & Target.Row & ":F" & Target.Row).Locked = True Me.Protect "toto" End If Exit Sub
YaUnOs: MsgBox "erreur dans la saisie des dates sur la colonne A", vbInformation, "Arrêt" Exit Sub
End Sub
Cordialement Pascal
"Cath" a écrit dans le message de news:
Bonjour,
Je me suis promené sur tout le forum mais je n'ai pas réussi à trouver une solution à mon problème.
J'ai une colonne A qui est des dates jj/mm/aa Si cette date est inférieur au mois en cours je dois vérouiller la ligne de A à F.
voilà d'ou je pars, merci de votre aide sachant que j'ai la version Excel 2000
Private Sub Worksheet_Change(ByVal zz As Range)
If zz.Locked = False Then ActiveSheet.Unprotect "toto" zz.Locked = True ActiveSheet.Protect "toto" End If
End Sub
papou
Bon je savais bien que j'avais été un peu vite (!), à modifier comme ceci :
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column > 1 Then Exit Sub If Target.Value = "" Then Exit Sub If Target.Cells.Count > 1 Then Exit Sub On Error GoTo YaUnOs Select Case Month(Target.Value) Case Is > Month(today) Exit Sub Case Is < Month(today) If Target.Locked = False Then Me.Unprotect "toto" Range("A" & Target.Row & ":F" & Target.Row).Locked = True Me.Protect "toto" End If End Select Exit Sub
YaUnOs: MsgBox "erreur dans la saisie des dates sur la colonne A", vbInformation, "Arrêt" Exit Sub
End Sub "papou" <cestpasbon@çanonplus> a écrit dans le message de news:
Bonjour Sortie du four sans trop de tests :
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column > 1 Then Exit Sub If Target.Value = "" Then Exit Sub If Target.Cells.Count > 1 Then Exit Sub On Error GoTo YaUnOs Select Case Month(Target.Value) Case Is > Month(today) Exit Sub Case Is < Month(today) End Select If Target.Locked = False Then Me.Unprotect "toto" Range("A" & Target.Row & ":F" & Target.Row).Locked = True Me.Protect "toto" End If Exit Sub
YaUnOs: MsgBox "erreur dans la saisie des dates sur la colonne A", vbInformation, "Arrêt" Exit Sub
End Sub
Cordialement Pascal
"Cath" a écrit dans le message de news:
Bonjour,
Je me suis promené sur tout le forum mais je n'ai pas réussi à trouver une solution à mon problème.
J'ai une colonne A qui est des dates jj/mm/aa Si cette date est inférieur au mois en cours je dois vérouiller la ligne de A à F.
voilà d'ou je pars, merci de votre aide sachant que j'ai la version Excel 2000
Private Sub Worksheet_Change(ByVal zz As Range)
If zz.Locked = False Then ActiveSheet.Unprotect "toto" zz.Locked = True ActiveSheet.Protect "toto" End If
End Sub
Bon je savais bien que j'avais été un peu vite (!), à modifier comme ceci :
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column > 1 Then Exit Sub
If Target.Value = "" Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo YaUnOs
Select Case Month(Target.Value)
Case Is > Month(today)
Exit Sub
Case Is < Month(today)
If Target.Locked = False Then
Me.Unprotect "toto"
Range("A" & Target.Row & ":F" & Target.Row).Locked = True
Me.Protect "toto"
End If
End Select
Exit Sub
YaUnOs:
MsgBox "erreur dans la saisie des dates sur la colonne A", vbInformation,
"Arrêt"
Exit Sub
End Sub
"papou" <cestpasbon@çanonplus> a écrit dans le message de news:
ey8ZSvDTGHA.224@TK2MSFTNGP10.phx.gbl...
Bonjour
Sortie du four sans trop de tests :
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column > 1 Then Exit Sub
If Target.Value = "" Then Exit Sub
If Target.Cells.Count > 1 Then Exit Sub
On Error GoTo YaUnOs
Select Case Month(Target.Value)
Case Is > Month(today)
Exit Sub
Case Is < Month(today)
End Select
If Target.Locked = False Then
Me.Unprotect "toto"
Range("A" & Target.Row & ":F" & Target.Row).Locked = True
Me.Protect "toto"
End If
Exit Sub
YaUnOs:
MsgBox "erreur dans la saisie des dates sur la colonne A", vbInformation,
"Arrêt"
Exit Sub
End Sub
Cordialement
Pascal
"Cath" <Cath@discussions.microsoft.com> a écrit dans le message de news:
4B1C79CA-A1FA-4E17-BFE9-9C1D65F6E6EB@microsoft.com...
Bonjour,
Je me suis promené sur tout le forum mais je n'ai pas réussi à trouver
une
solution à mon problème.
J'ai une colonne A qui est des dates jj/mm/aa
Si cette date est inférieur au mois en cours je dois vérouiller la ligne
de
A à F.
voilà d'ou je pars, merci de votre aide sachant que j'ai la version
Excel
2000
Private Sub Worksheet_Change(ByVal zz As Range)
If zz.Locked = False Then
ActiveSheet.Unprotect "toto"
zz.Locked = True
ActiveSheet.Protect "toto"
End If
Bon je savais bien que j'avais été un peu vite (!), à modifier comme ceci :
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column > 1 Then Exit Sub If Target.Value = "" Then Exit Sub If Target.Cells.Count > 1 Then Exit Sub On Error GoTo YaUnOs Select Case Month(Target.Value) Case Is > Month(today) Exit Sub Case Is < Month(today) If Target.Locked = False Then Me.Unprotect "toto" Range("A" & Target.Row & ":F" & Target.Row).Locked = True Me.Protect "toto" End If End Select Exit Sub
YaUnOs: MsgBox "erreur dans la saisie des dates sur la colonne A", vbInformation, "Arrêt" Exit Sub
End Sub "papou" <cestpasbon@çanonplus> a écrit dans le message de news:
Bonjour Sortie du four sans trop de tests :
Private Sub Worksheet_Change(ByVal Target As Range) If Target.Column > 1 Then Exit Sub If Target.Value = "" Then Exit Sub If Target.Cells.Count > 1 Then Exit Sub On Error GoTo YaUnOs Select Case Month(Target.Value) Case Is > Month(today) Exit Sub Case Is < Month(today) End Select If Target.Locked = False Then Me.Unprotect "toto" Range("A" & Target.Row & ":F" & Target.Row).Locked = True Me.Protect "toto" End If Exit Sub
YaUnOs: MsgBox "erreur dans la saisie des dates sur la colonne A", vbInformation, "Arrêt" Exit Sub
End Sub
Cordialement Pascal
"Cath" a écrit dans le message de news:
Bonjour,
Je me suis promené sur tout le forum mais je n'ai pas réussi à trouver une solution à mon problème.
J'ai une colonne A qui est des dates jj/mm/aa Si cette date est inférieur au mois en cours je dois vérouiller la ligne de A à F.
voilà d'ou je pars, merci de votre aide sachant que j'ai la version Excel 2000
Private Sub Worksheet_Change(ByVal zz As Range)
If zz.Locked = False Then ActiveSheet.Unprotect "toto" zz.Locked = True ActiveSheet.Protect "toto" End If