Need VBA Coding

Hi Experts,

Please help me with code. I have attached excel file. In that Column D has resource name, there if there name is repeating for more than 2 times shows some pop up or highlight the repeated.
Book1.xlsx
Smith WilliamAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"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.

aranaCommented:
There is no attachment, also please share more detail in what you want to accomplish, or some example of your target result
0
ste5anSenior DeveloperCommented:
E.g. in a standard module:

Option Explicit

Public Sub Run()

  MarkContinousValues ActiveSheet.Columns("D")

End Sub

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
        Exit For
      End If
    End If
    
    If PreviousValue = Cell.Value Then
      RepetionCount = RepetionCount + 1
      If RepetionCount >= 2 Then
        Cell.Font.Color = RGB(255, 0, 0)
      End If
    Else
      RepetionCount = 0
    End If
    
    PreviousValue = Cell.Value
  Next Cell

End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Smith WilliamAuthor Commented:
Thank you Ste5an
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
VBA

From novice to tech pro — start learning today.