728x90

Sub 중복데이터제거()
    Range("A1:D" & Cells(Rows.Count, "A").End(3).Row).RemoveDuplicates Columns:=Array(3, 4), Header:=xlYes
End Sub

Sub 직위중복제거()
    Range("A1:B" & Cells(Rows.Count, "A").End(3).Row).RemoveDuplicates Columns:=Array(2), Header:=xlYes
End Sub

Sub name_delete()
    Dim r As Long, d As Long, k As Long, LastRow As Long
   
    Application.ScreenUpdating = False
    LastRow = Cells(Rows.Count, "A").End(3).Row
       
    For r = LastRow To 6 Step -1
        If Cells(r, "A") = "이름" And Cells(r, "B") = "부서명" Then
            Rows(r).EntireRow.Delete
            k = k + 1
        ElseIf IsEmpty(Cells(r, "A")) And IsEmpty(Cells(r, "B")) Then
            Rows(r).EntireRow.Delete
            d = d + 1
        End If
    Next r
   
    MsgBox k & "행 이름삭제 " & d & "빈행 삭제완료"
End Sub

728x90
블로그 이미지

Link2Me

,