Excel Blinking Cells VBA Code

Published: 09 December 2020
on channel: 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


On this page of the site you can watch the video online Excel Blinking Cells VBA Code with a duration of hours minute second in good quality, which was uploaded by the user SoftTech Tutorials 09 December 2020, share the link with friends and acquaintances, this video has already been watched 6,258 times on youtube and it was liked by 29 viewers. Enjoy your viewing!