Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

TARGET

2 réponses
Avatar
IMER09
BONJOUR A TOUS

J'ai ce qui suit:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 56 And Target.Count = 1 And Target.Value = "OK" Then
ActiveSheet.Unprotect
Range(Cells(Target.Row, 1), Cells(Target.Row, 56)).Locked = True
Range(Cells(Target.Row, 1), Cells(Target.Row,
56)).Interior.ColorIndex = 33
ActiveSheet.Protect
End If
End Sub
Quand je selectionne une seul cells pas de pb
mais qd je fais une selection multiple
et que je veux par ex effacer le contenu : BUG
Je ne sais quoi faire

Merci

--
IMER09

2 réponses

Avatar
JB
Bonjour,

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 56 And Target.Count = 1 Then
If Target.Value = "OK" Then
ActiveSheet.Unprotect
Range(Cells(Target.Row, 1), Cells(Target.Row, 56)).Locked True
Range(Cells(Target.Row, 1), Cells(Target.Row,
56)).Interior.ColorIndex = 33
ActiveSheet.Protect
End If
End If
End Sub

JB


On 15 nov, 11:30, IMER09 wrote:
BONJOUR A TOUS

J'ai ce qui suit:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 56 And Target.Count = 1 And Target.Value = "OK" Then
ActiveSheet.Unprotect
Range(Cells(Target.Row, 1), Cells(Target.Row, 56)).Locked = True
Range(Cells(Target.Row, 1), Cells(Target.Row,
56)).Interior.ColorIndex = 33
ActiveSheet.Protect
End If
End Sub
Quand je selectionne une seul cells pas de pb
mais qd je fais une selection multiple
et que je veux par ex effacer le contenu : BUG
Je ne sais quoi faire

Merci

--
IMER09


Avatar
IMER09
le nez au milieu de la ....

Merci JB
--
IMER09



Bonjour,

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 56 And Target.Count = 1 Then
If Target.Value = "OK" Then
ActiveSheet.Unprotect
Range(Cells(Target.Row, 1), Cells(Target.Row, 56)).Locked > True
Range(Cells(Target.Row, 1), Cells(Target.Row,
56)).Interior.ColorIndex = 33
ActiveSheet.Protect
End If
End If
End Sub

JB


On 15 nov, 11:30, IMER09 wrote:
BONJOUR A TOUS

J'ai ce qui suit:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 56 And Target.Count = 1 And Target.Value = "OK" Then
ActiveSheet.Unprotect
Range(Cells(Target.Row, 1), Cells(Target.Row, 56)).Locked = True
Range(Cells(Target.Row, 1), Cells(Target.Row,
56)).Interior.ColorIndex = 33
ActiveSheet.Protect
End If
End Sub
Quand je selectionne une seul cells pas de pb
mais qd je fais une selection multiple
et que je veux par ex effacer le contenu : BUG
Je ne sais quoi faire

Merci

--
IMER09