Excel Blinking Cells VBA Code

Veröffentlicht am: 09 Dezember 2020
auf dem Kanal: 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


Auf dieser Seite können Sie das Online-Video Excel Blinking Cells VBA Code mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer SoftTech Tutorials 09 Dezember 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 6,258 Mal angesehen und es wurde von 29 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!