LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Macro to Delete Duplicate Cells

Works perfectly! This is exactly what I needed. Thank you so much!

"Gary''s Student" wrote:

Try:

Sub CleanA()
Dim n As Long
n = Cells(Rows.Count, "A").End(xlUp).Row
For i = n To 2 Step -1
m = Application.WorksheetFunction.CountIf(Range("A1:A" & i), Range("A" &
i).Value)
If m 1 Then
Range("A" & i).Delete Shift:=xlUp
End If
Next
End Sub

--
Gary''s Student - gsnu201001


"MCRH" wrote:

Hi,

I've seen other questions regarding deleting duplicates but none of them
quite fit what I need.

I have values in column A. I want to delete the cell (shift up) of any and
all exact duplicates, but keep the original.

Thanks for your help!

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find duplicate, save in a list, delete duplicate using macro Erica[_3_] Excel Programming 1 January 27th 10 06:53 PM
how do i delete duplicate cells in the same row Davidk Excel Discussion (Misc queries) 1 December 6th 07 12:00 AM
How do I delete duplicate cells? AYANG Excel Worksheet Functions 1 June 27th 06 06:29 AM
using a macro to delete duplicate data (cells) Dave Peterson[_3_] Excel Programming 0 September 17th 04 02:33 AM
using a macro to delete duplicate data (cells) HL Excel Programming 0 September 16th 04 03:49 PM


All times are GMT +1. The time now is 07:17 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"