Excel Blinking Cells VBA Code

Publicado em: 09 Dezembro 2020
no canal de: SoftTech Tutorials
6,258
29

Excel Blinking Cell VBA

0:00 Introduction blinking cell
0:34 Developer tab
0:57 VBA code overview
2:57 Blinking cell variables
3:24 Storing all cells
4:10 Add blinking

Below you can find the VBA codes that we used in this Excel Blinking Cell VBA tutorial:

'Initializing variables
Dim score As Range
Set score = Range("C3", Range("C3").End(xlDown))

Dim scoreValue As Range

Dim blinkingCellsVect As Range

Dim highlightCellsVect As Range

Dim targetValue As Range
Set targetValue = Range("F2")
-------------------------

'Storing all cells to highlight
If Not Intersect(Target, Union(score, targetValue)) Is Nothing Then

For Each scoreValue In score
If scoreValue.Value > targetValue.Value Then
If highlightCellsVect Is Nothing Then
Set highlightCellsVect = scoreValue
Else
Set highlightCellsVect = Union(highlightCellsVect, scoreValue)
End If
ElseIf scoreValue.Value > targetValue.Value - 500 And scoreValue.Value < targetValue.Value Then
If blinkingCellsVect Is Nothing Then
Set blinkingCellsVect = scoreValue
Else
Set blinkingCellsVect = Union(blinkingCellsVect, scoreValue)
End If

End If

Next scoreValue

------------------------

'Color cells and add blinking
highlightCellsVect.Interior.ColorIndex = 35

For i = 1 To 3

blinkingCellsVect.Interior.ColorIndex = 36
Application.Wait (Now + TimeValue("0:00:01"))
blinkingCellsVect.Interior.ColorIndex = 0
Application.Wait (Now + TimeValue("0:00:01"))
blinkingCellsVect.Interior.ColorIndex = 36
Application.Wait (Now + TimeValue("0:00:01"))

Next i


End If

End Sub

---------------

This concludes our Excel Blinking Cell VBA tutorial. I'm inspired by content creators as Leila Gharani and Teacher's Tech.

#Excel #Tutorial #VBA


Nesta página do site você pode assistir ao vídeo on-line Excel Blinking Cells VBA Code duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário SoftTech Tutorials 09 Dezembro 2020, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 6,258 vezes e gostou 29 espectadores. Boa visualização!