Mrrrr's Forum (VIEW ONLY)
Un forum care ofera solutii pentru unele probleme legate in general de PC. Pe langa solutii, aici puteti gasi si alte lucruri interesante // A forum that offers solutions to some PC related issues. Besides these, here you can find more interesting stuff.
Lista Forumurilor Pe Tematici
Mrrrr's Forum (VIEW ONLY) | Reguli | Inregistrare | Login

POZE MRRRR'S FORUM (VIEW ONLY)

Nu sunteti logat.
Nou pe simpatie:
Jasmmyne la Simpatie.ro
Femeie
22 ani
Bucuresti
cauta Barbat
22 - 34 ani
Mrrrr's Forum (VIEW ONLY) / Tutoriale si Ghiduri Utile // Tutorials and useful guides / [EXCEL] Highlight Duplicates in a Column [VBA] Moderat de TRaP, TonyTzu
Autor
Mesaj Pagini: 1
TonyTzu
Moderator

Inregistrat: acum 12 ani
Postari: 252
Found part of the code at Source website, and I adapted it to apply to selection instead of predefined column.


Sub DupesHighlightInColumn()
    Dim LastRow As Long
    Dim c, cell As Range
    Dim myCol As Integer
       
Application.ScreenUpdating = False
With ActiveSheet

    Set c = Selection
    myCol = c.Columns.Column
    LastRow = .Cells(Rows.Count, myCol).End(xlUp).Row

For Each cell In c
    If WorksheetFunction.CountIf(c, cell.Value) > 1 Then
        cell.Interior.ColorIndex = 6
        Else: cell.Interior.ColorIndex = 0
    End If
        If cell.Rows.Row = LastRow Then Exit For
Next

End With
Application.ScreenUpdating = True

End Sub


Source:


pus acum 5 ani
   
Pagini: 1  

Mergi la