Macro ne fonctionne pas

  • Initiateur de la discussion Initiateur de la discussion Alain du 78
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

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
 
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
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD
Assurez vous de marquer un message comme solution pour une meilleure transparence.

Discussions similaires

Retour