Consulting

Results 1 to 5 of 5

Thread: need help in code enhancement

  1. #1
    VBAX Regular
    Joined
    Dec 2014
    Posts
    69
    Location

    need help in code enhancement

    Hi all,

    Can anyone be able to find alternative for the code below, this takes lot of time to execute. Thanks!

    For i = ws2.UsedRange.Rows.Count To 2 Step (-1)
        If ws2.Range("I" & i).Value = ws2.Range("I" & i - 1).Value Then
            ws2.Range("I" & i).EntireRow.Delete
        End If
    Next

    crossposted here
    http://www.mrexcel.com/forum/excel-q...ml#post4078629

  2. #2
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,635
    advanced filter, unique =true

  3. #3
    VBAX Regular
    Joined
    Dec 2014
    Posts
    69
    Location
    Hi snb,

    Can you get me your suggestion in code version? Thanks!

  4. #4
    Knowledge Base Approver VBAX Wizard
    Joined
    Apr 2012
    Posts
    5,635
    Your Excel has a macro recorder too.

  5. #5
    VBAX Regular
    Joined
    Dec 2014
    Posts
    69
    Location
    Yep got it. I solved it. Thanks!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •