Macro ne fonctionne pas

A

Alain du 78

Guest
Bonjour le forum
J'ai trouvé cette macro que je souhaite utiliser mais qui, malheureusement ne fonctionne pas. Je vous remercie d'où vient l'erreur.

Dans Worksheet :

Attribute VB_Name = 'CelluleClignoteSiCondition'

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range('B6:H99')) Is Nothing Then CLIGNOTE
Target.Select
End Sub

Dans un Module :

Sub CLIGNOTE()
'Alain Vallon, mpfe
For Each Cell In Range('B6:H99').Find _
(What:=Application.WorksheetFunction.Min([B6:H99]), LookAt:=xlWhole).Activate
mémo1 = ActiveCell.Font.ColorIndex
'mémo2 = ActiveCell.Font.Size
For x = 1 To 5
For i = 1 To 20
ActiveCell.ColorIndex = 3
'ActiveCell.Font.Size = i
Sleep (5)
DoEvents
Next i
'ActiveCell.Font.Size = 12
ActiveCell.Font.ColorIndex = 3
Next x
ActiveCell.Font.ColorIndex = mémo1
'ActiveCell.Font.Size = mémo2
Next
End Sub
 

Bebere

XLDnaute Barbatruc
bonjour Alain
fonctionne comme suit(sleep en commentaires)
est ce une fonction ou une sub(temporisation?) ?
Sub CLIGNOTE()
'Alain Vallon, mpfe
cherch = Application.WorksheetFunction.Min([B6:H99])
For Each Cell In Range('B6:H99') '.Find(cherch).Activate
If Cell = cherch Then
Cell.Activate
mémo1 = ActiveCell.Font.ColorIndex
'mémo2 = ActiveCell.Font.Size
For x = 1 To 5
For i = 1 To 20
'mis ligne suivante en commentaire et ajouter interior
'ActiveCell.Interior.ColorIndex = 3
'ActiveCell.Font.Size = i
'Sleep (5)
DoEvents
Next i
'ActiveCell.Font.Size = 12
ActiveCell.Font.ColorIndex = 3
Next x
ActiveCell.Font.ColorIndex = mémo1
'ActiveCell.Font.Size = mémo2
End If
Next
End Sub
à bientôt



End Sub
 

Discussions similaires