OVH Cloud OVH Cloud

Fonctionne avec Excel 2000 pas avec Excel 97

2 réponses
Avatar
Florian
Bonsoir
Cette procédure fonctionne très bien chez moi avec Excel 2000
En revanche au travail avec EXcel 97 cela ne fonctionne pas du tout, aucun
message d'erreur rien !
Merci de votre aide
Flo riant

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If Not Intersect([D3:D102], Target) Is Nothing And .Cells.Count = 1 Then
If .Value = "4,5 jours" And .Offset(0, 1) = "" Then
.Offset(0, 1).Select
MsgBox "Vous devez choisir une demi-journée de fermeture ici !",
vbInformation, _
" Demi-journée de fermeture ?"
Call Clignote_cell
End If
End If
End With
End Sub

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Clignote_cell()
ActiveSheet.Unprotect Password:="toto"
Dim i As Byte
For i = 1 To 6
Sleep 100
With ActiveCell.Interior
.ColorIndex = 2
End With
Sleep 100
With ActiveCell.Interior
.ColorIndex = 4
End With
Next i
ActiveCell.Interior.ColorIndex = 0
ActiveSheet.Protect Password:="toto"
End Sub

2 réponses

Avatar
Daniel
Bonsoir.
Il me semble avoir lu ici de la plume d'un augure que l'évènement
Worksheet_Change ne fonctionnerait pas forcément bien avec XL97. Saisis-tu
quelque chose dans la cellule ou la mise à jour se fait-elle par liaison ?
Dans ce dernier cas, cela ne fonctionnerait pas.
Cordialement.
Daniel
"Florian" a écrit dans le message de news:

Bonsoir
Cette procédure fonctionne très bien chez moi avec Excel 2000
En revanche au travail avec EXcel 97 cela ne fonctionne pas du tout, aucun
message d'erreur rien !
Merci de votre aide
Flo riant

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If Not Intersect([D3:D102], Target) Is Nothing And .Cells.Count = 1
Then
If .Value = "4,5 jours" And .Offset(0, 1) = "" Then
.Offset(0, 1).Select
MsgBox "Vous devez choisir une demi-journée de fermeture ici
!", vbInformation, _
" Demi-journée de fermeture ?"
Call Clignote_cell
End If
End If
End With
End Sub

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Clignote_cell()
ActiveSheet.Unprotect Password:="toto"
Dim i As Byte
For i = 1 To 6
Sleep 100
With ActiveCell.Interior
.ColorIndex = 2
End With
Sleep 100
With ActiveCell.Interior
.ColorIndex = 4
End With
Next i
ActiveCell.Interior.ColorIndex = 0
ActiveSheet.Protect Password:="toto"
End Sub



Avatar
AV
Evènement "Worksheet_Change" et XL97 et une liste de validation ?
Si oui fais une petite recherche dans le forum (fils récents)
Si tu ne trouves pas, relance

AV