Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7593539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T21:11:43+00:00 2026-05-30T21:11:43+00:00

found a lot of questions involving finding duplicates in two columns : i.e. MS

  • 0

found a lot of questions involving finding duplicates in two columns :

i.e.
MS Excel how to create a macro to find duplicates and highlight them? and excel mark duplicates values

However I’m trying to adapt code to be used to find duplicates in one column. For example here is a data set:

Column 1

Foo
Bar
23
23
12
foo
Bar
bart

This is what I’m using right now:

Function warnDupes()

Dim lastRow As Long
Dim dict As Object

' Let Col be the column which warnDupes operates on.
Dim Col As String

Col = "A"

Set dict = CreateObject("scripting.dictionary")

lastRow = range(Col & Rows.Count).End(xlUp).Row

On Error Resume Next
For i = lastRow To 1 Step -1
    If dict.Exists(range(Col & i).value) = True Then

    'range("Y" & i).EntireRow.Delete

    MsgBox ("Hmm...Seems to be a duplicate of " & range(Col & i).value & _
    " in Cell " & Col & i)

End If
dict.Add range(Col & i).value, 1
Next

End Function

So far I’ve got some code that does 90% of the job. 23 and 23 are matched. Bar and Bar are matched. etc. So the code matches both Strings and Ints. But I’d like the macro to be able to match Foo and foo as a duplicate as well. How do I make Excel ignore case?

This question ( Function for detecting duplicates in Excel sheet ) seems relevent but I’m having trouble adapting the code or understanding what the author did. Any improvements to the code, explanations or suggestions would be very much appreciated.

Thanks.

UPDATE:

Just noticed something really weird.

The data:

IB6061
IC6071

are matched whether I use my Macro or if I use the Conditional Formatting tool in Excel. Any reason why?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T21:11:44+00:00Added an answer on May 30, 2026 at 9:11 pm

    On your Exists() & .Add() lines, make both values the same case:

    If dict.Exists(UCase$(Range(Col & i).Value)) Then
    

    and

    dict.Add UCase$(Range(Col & i).Value), 1

    That way the duplicates will always be added to the dictionary in uppercase and so case will never matter.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've already found a lot of questions about manipulating the highlight of items to
I found a lot of questions about how to initialize jQuery plugins with dynamic
i found a lot of questions about resizing images in .NET and whatnot, but
I've looked around and found a lot of questions about this, but none of
I found a lot of links on metaclasses, and most of them mention that
I found a lot of answers how to transform rows into columns in SQL.
I found a lot of similar questions, but not quite the solution to this
I've found a lot of questions on .inputrc, and the answers included people using
I found a lot of tutorials and forum questions around remapping key bindings in
I have search through quite a lot of questions here, but havent found one

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.