![]() |
#1
|
|||
|
|||
![]()
Hi All,
I have the macro below that I run on several worksheets with no issues. But on all of them it runs on Column "A". I need to modify it to run on a different column on a new worksheet but I am not having any success. Can someone help? Sub luxation() Dim N As Long N = Cells(Rows.Count, 1).End(xlUp).Row For i = N To 2 Step -1 If Cells(i, 1) = Cells(i - 1, 1) Then Cells(i, 1) = "" End If Next i End Sub |
#2
|
|||
|
|||
![]()
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 |
#3
|
|||
|
|||
![]()
Snakehips,
Thanks very much for your quick reply. It worked perfect. |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
nwcf | Excel | 3 | 01-31-2014 09:43 AM |
![]() |
netchie | Word VBA | 4 | 03-14-2013 02:22 PM |
![]() |
excelledsoftware | PowerPoint | 2 | 03-01-2012 07:29 PM |
![]() |
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 |