Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-18-2015, 10:10 AM
Snakehips Snakehips is offline Macro to keep first instance and remove duplicates in certain column Windows 8 Macro to keep first instance and remove duplicates in certain column Office 2013
Advanced Beginner
 
Join Date: Mar 2015
Posts: 36
Snakehips is on a distinguished road
Default

zhead,

Perhaps ......

Code:
Sub luxation()
Dim N As Long
Dim c As Integer
'assumes you have the header selected (row 1) for your column of interest
If Selection.Columns.Count > 1 Then Exit Sub

col = Selection.Column  'sets the column number

N = Cells(Rows.Count, col).End(xlUp).Row
For i = N To 2 Step -1
If Cells(i, col) = Cells(i - 1, col) Then
Cells(i, col) = ""
End If
Next i

End Sub
Hope that helps.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to keep first instance and remove duplicates in certain column Need help on duplicates in column; deciding which to keep based on other column nwcf Excel 3 01-31-2014 09:43 AM
Macro to keep first instance and remove duplicates in certain column Macro to remove blank column netchie Word VBA 4 03-14-2013 02:22 PM
Macro to keep first instance and remove duplicates in certain column Macro To Delete Instance across multiple slides. excelledsoftware PowerPoint 2 03-01-2012 07:29 PM
Macro to keep first instance and remove duplicates in certain column Deleting Duplicates in Macro jillapass Excel Programming 1 01-11-2012 10:02 AM
Macro to remove duplicates in Refrences list HowardC Word VBA 0 05-20-2010 09:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:34 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft