Experts Exchange Solution brought to you by
"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.
Public Sub Run()
Public Sub MarkContinousValues(ARange As Excel.Range)
Const BAILOUT As Long = 16
Dim Cell As Excel.Range
Dim BailoutCount As Long
Dim PreviousValue As Variant
Dim RepetionCount As Long
For Each Cell In ARange.Cells
If Cell.Value = vbEmpty Then
BailoutCount = BailoutCount + 1
If BailoutCount >= BAILOUT Then
If PreviousValue = Cell.Value Then
RepetionCount = RepetionCount + 1
If RepetionCount >= 2 Then
Cell.Font.Color = RGB(255, 0, 0)
RepetionCount = 0
PreviousValue = Cell.Value
Open in new window
Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.
From novice to tech pro — start learning today.
Members can enroll in this course at no extra cost.