Bonjour les amis, il est 03h45 et je cherche encore la solution à mon problème! je viens donc demander votre aide
Voici ma macro de depart
Sub date_jour()
Dim la_date As Variant
Dim i As Integer
Dim j As Integer
Dim c As Integer
ActiveSheet.Unprotect "#######"
For i = 2 To Range("H" & Rows.Count).End(xlUp).Row
If IsDate(Cells(i, 8)) Then
If Cells(i, 8) <= Date + 15 And Cells(i, 10) <> "NON" And Cells(i, 11) <> "NON" Then
Cells(i, 15).Select
ActiveCell = "ALERTE 2"
ActiveCell.Font.ColorIndex = 3
ActiveCell.Font.Bold = True
ActiveCell.Font.Italic = True
ActiveCell.Select
Call alerte_info
Cells(i, 8).Select
Call clignotte
End If
End If
If Cells(i, 8) <= Date + 15 And Cells(i, 10) = "NON" Then
Call condition_nul
Cells(i, 8).Select
Call clignotte
End If
If Cells(i, 8) <= Date + 15 And Cells(i, 11) = "NON" Then
Call condition_nul
Cells(i, 8).Select
Call clignotte
End If
Next i
ActiveSheet.Protect "######"
End Sub
Et voici la macro imbriguée
Sub clignote()
Dim ma_ligne As Long
Dim ma_plage As Object
ma_ligne = ActiveCell.Row
Set ma_plage = Range(Cells(ma_ligne, 1), Cells(ma_ligne, 14))
[ma_plage].Interior.Color = vbWhite
Do While Not IsEmpty([ActiveCell])
If [ma_plage].Interior.Color = vbRed Then
[ma_plage].Interior.Color = vbWhite
Else
[ma_plage].Interior.Color = vbRed
End If
DoEvents
Call Wait
Loop
Exit Sub
[ma_plage].Interior.Color = vbWhite
End Sub
Sub Wait()
' Attendre 5 secondes
Application.Wait Time + TimeSerial(0, 0, 1)
' Continuer après la pause
End Sub
Le souci est que lorsque la première condition de la macro date_jour() est vérifié et que automatiquement la macro clignote() se déclenche,étant donnée qu'elle est une boucle, le next i n'est plus pris en compte et ma macro date_jour est en arrêt.
Je souhaiterais que toutes les cellules de la colonne en question, c'est a dire de 2 to Range("H" & Rows.Count).End(xlUp).Row qui repondent aux conditions "if..." clignotent en même temsp! Comment je dois m y prendre? J'ai essaye avec un tableau mémorisé mais j'ai vraiment du mal à avancer!
Merci d'avance pour celui ou ceux qui me viendront en aide!