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

Procédure qui ne fonctionne pas avec Excel 97

1 réponse
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 !
Il s'agit effectivement de l'évènement "Worksheet_Change" et XL97 et une
liste de validation.
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

1 réponse

Avatar
Youky
Bonsoir,
J'ai eu de gros problèmes avec les cellules fusionnées, si tu en as en
[D3:D102] fait un essai en les défusionnant, idem pour les selectées


"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 !
Il s'agit effectivement de l'évènement "Worksheet_Change" et XL97 et une
liste de validation.
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