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 7024551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:51:18+00:00 2026-05-27T23:51:18+00:00

I have a list containing three columns. The first column contains Names and the

  • 0

I have a list containing three columns. The first column contains Names and the other two columns have numbers. The macro takes the first name(A1) and then searches down column A for another occurrence.

When it finds it, it deletes the entire row.It then goes to A2 and does the same thing agan. It works ok for about 500 entries, but using 3000 entries slows it down considerably. Is there a way to speed up this code?

Sub Button1_DeleteRow()

Dim i As Integer
Dim j As Integer    
Dim Value As Variant
Dim toCompare As Variant

For i = 1 To 3000      
    Value = Cells(i, 1)
    For j = (i + 1) To 3000
        toCompare = Cells(j, 1)
        If (StrComp(Value, toCompare, vbTextCompare) = 0) Then
           Rows(j).EntireRow.Delete
        End If
      Next j  
Next i

End Sub 
  • 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-27T23:51:19+00:00Added an answer on May 27, 2026 at 11:51 pm

    If you are running xl07/10 then you can do this with a single line with Remove Duplicates. If you are running 03 then a solution with AutoFilter will be most efficient (I can provide this if you are on the older version)

    Remove Duplicates

    1. Manually

      • Select column A
      • Data …. Remove Duplicates
      • Expand selection
      • Select only column A to find duplicates on
    2. Code

      ActiveSheet.Range("$A$1:$A$3000").EntireRow.RemoveDuplicates Columns:=1, Header:=xlNo

    before
    only A
    after

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

Sidebar

Related Questions

I have two tables containing three columns containing the same types of information(id, attributes,
I have a table containing (essentially) three columns - id, name, ref_id. I would
I have two different collections: List<int> IEnumerable<IDataRecord> The first contains a list of primary
Let's say I have this list: my @list = qw(one two three four five);
I have to encrypt a list containing three fields for each record (a tag,
I have a table that contains alot of columns with ids(keys) corresponding to other
I have four tables. The first contains a list of volunteers , the second
I have a List containing several keywords. I foreach through them building my linq
I have a list containing a tuples and long integers the list looks like
I have a list containing version strings, such as things: versions_list = [1.1.2, 1.0.0,

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.