Nico Learning
New Member
- Joined
- May 15, 2009
- Messages
- 20
Hi
Hope someone out there can help me with this one,
im trying to identify the duplicate that i have on my spread sheet, i found a really good VBA code that work really will but the problem that i have is that i dont know how to amend it to show across several column (basically i want to to show me if there is any duplication in column A,B,C and D.) i.e. if i have john in B1 and also have John in D3 i want it be able to locate these by highlighting them. please see to code below, "found it on the internet"
Sub MakeDupsYellow()
Dim myRange As Range
Dim strColToSort As String
'Note: first cell in column is considered a heading
' and is not included in the filter.
strColToSort = "B"
Application.ScreenUpdating = False
Set myRange = Columns(strColToSort & ":" & strColToSort)
myRange.Interior.ColorIndex = 45
myRange.AdvancedFilter Action:=xlFilterInPlace, Unique:=True
myRange.Interior.ColorIndex = xlNone
ActiveSheet.ShowAllData
Application.ScreenUpdating = True
End Sub
Kind Regards
Nick
Hope someone out there can help me with this one,
im trying to identify the duplicate that i have on my spread sheet, i found a really good VBA code that work really will but the problem that i have is that i dont know how to amend it to show across several column (basically i want to to show me if there is any duplication in column A,B,C and D.) i.e. if i have john in B1 and also have John in D3 i want it be able to locate these by highlighting them. please see to code below, "found it on the internet"
Sub MakeDupsYellow()
Dim myRange As Range
Dim strColToSort As String
'Note: first cell in column is considered a heading
' and is not included in the filter.
strColToSort = "B"
Application.ScreenUpdating = False
Set myRange = Columns(strColToSort & ":" & strColToSort)
myRange.Interior.ColorIndex = 45
myRange.AdvancedFilter Action:=xlFilterInPlace, Unique:=True
myRange.Interior.ColorIndex = xlNone
ActiveSheet.ShowAllData
Application.ScreenUpdating = True
End Sub
Kind Regards
Nick