Hi All,
is there any way that i can have a macro that will delete the duplicates in column AC?
Thanks!
Hi All,
is there any way that i can have a macro that will delete the duplicates in column AC?
Thanks!
Maybe:Please Login or Register to view this content.
Last edited by Mumps1; 08-05-2015 at 11:19 AM.
You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
Practice makes perfect. I'm very far from perfect so I'm still practising.
Maybe:
Please Login or Register to view this content.
Hi John,
Thanks for this, but i need to retain my headers. I just need the code to run from AC4 going down. Any idea?
Maybe:
Please Login or Register to view this content.
Here's another version.
Please Login or Register to view this content.
Hi John,
can you see the attached file so you can check? It seems like its not removing dups and spaces as well.
or i did it wrong?
For the last code you gave it was actually working but i need the column headers
Please Login or Register to view this content.
hi AB33,
Uusing your code but i was able to remove duplicate but the spaces remains.
Actually - the code AB33 gave should be removing those spaces w/o a sort.
Here's what I got from the macro recorder(modified a bit) - this moves the values into one continuous list at the top w/o sorting the sheet.
That should be all that is neededPlease Login or Register to view this content.
Last edited by GeneralDisarray; 08-07-2015 at 09:22 AM.
Remember, saying thanks only takes a second or two. Click the star icon(*) below the post you liked, to give some Rep if you think an answer deserves it.
Please,mark your thread [SOLVED] if you received your answer.
Hi GeneralDisarray,
yes i need this to happen without the sorting
I do not know what kind of spaces, if they are chr(10).
Please Login or Register to view this content.
Hi AB33,
there will be an instance that in column AJ, that the duplicates will have spaces - meaning blank cells before them like this in the attached file.
I have to remove duplicates as well as to remove the spcaes betweem them also.
Sorry not not clearly explaning
Hi -
How about like this one?
eventPlease Login or Register to view this content.
Hi GeneralDisarray
I got your code its actually working but i have data in AJ4, the code starts to run below it meaning from Aj5 downward and now i got double A in Column Aj and its has spaces. Attached is the file
hi event21 ,
perfect! Thank you so much!
Ok, I was being dense... the sort is OK you can localize it to just that column:
ALSO - you were saying "spaces" buy you meant "blank cells" - In your example the blanks really were blank. If you have cells with multiple spaces within them that appear blank, we'll need to add another step (but it's 100% doable).
This does the following: Replaces blank cells with an easy to identify "ZZZZZZZZZZZZ" value. Removes duplicates, then sorts - that puts the "ZZZZZZZZZZZZ" on bottom. Finally, it does a last find-n-replace for that "ZZZZZZZZZZZZ" flag.
Please Login or Register to view this content.
Two blank rows are treated by excel as equal, hence duplicates, but if you want to remove them.
[Code]Sub RemoveDups()
With Sheets("Sheet1").Range("AJ4:AJ" & Range("AJ" & Rows.Count).End(xlUp).Row)
.Value = Application.Trim(.Value)
.RemoveDuplicates Columns:=Array(1), Header:=xlYes
.SpecialCells(4).EntireRow.Delete
End With
[Code]End Sub
Please Login or Register to view this content.
Thanks everyone who helped me!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks