View Full Version : Delete duplicate rows
Hi.
How to delete rows in a specific range by VBA
I.e
I want to delete duplicate rows in a table D10:K20.
you can use RemoveDuplicates method?
Can you give example.
I need a code to do that
This is what you want to do?
Option Explicit
Sub test()
Dim r As Range
Dim n As Long, i As Long
Dim col
Set r = Range("D10:K20")
n = r.Columns.Count - 1
ReDim col(0 To n)
For i = 0 To n
col(i) = i + 1
Next
r.RemoveDuplicates Columns:=CVar(col), Header:=xlNo
End Sub
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.