ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¨D±Ï¦p¦óÁYµuVBA°õ¦æ®É¶¡

¦^´_ 4# lilizzzz


Sub tt()
Dim xD, Arr, i&, j%, N& '
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([¤u§@ªí1!U1], [¤u§@ªí1!A65536].End(3)) '­ì¸ê®Æ¸Ë¤J¼Æ²Õ
    For i = 1 To UBound(Arr)
        If Not xD.exists(Arr(i, 1)) Then
            N = N + 1   '­pºâ¤£­«½Æ°ß¤@­Èªº¦¸¼Æ
            xD(Arr(i, 1)) = N   '¤£­«½Æ°ß¤@­Èªº¸Ë¤J¦r¨å
            For j = 1 To UBound(Arr, 2)   '±N°ß¤@­Èªº¨ä¥¦Äæ¦ìªº­È¸Ë¤J¼Æ²Õ
                Arr(N, j) = Arr(i, j)
            Next
        End If
    Next
Range("A1").Resize(UBound(Arr), UBound(Arr, 2)) = ""    '²M°£­ì¸ê®Æ
Range("A1").Resize(N, UBound(Arr, 2)) = Arr             '¶K¤W°ß¤@­È¬ÛÃöªº­È
End Sub

TOP

¦^´_ 7# lilizzzz


§A¥Î¦P¤@­ÓÀɮ׸ժº¶Ü?§Ú¥Î§AªºÀÉ®×´ú¸Õ¤£·|
§ï¦¨³o¼Ë¸Õ¸Õ
Sheets("¤u§@ªí1").Range(dr).EntireRow.Delete

TOP

¦^´_ 3# quickfixer


  ±z¦n¡A´ú¸Õ®É Range(dr).Delete Shift:=xlUp

·|¸õ¿ù

TOP

¦^´_ 2# samwang


    ±z¦n¡A¦b´ú¸Õ±zªºµ{¦¡½X®Éµo²{·|¦³¸ê®Æ¨S§R°£¨ìªº±¡ªp

TOP

¦^´_ 3# quickfixer


±z¦n¡A¤µ¤é·|´ú¸Õ±z©Ò´£¨ÑVBAÅçÃÒ¡AÅçÃÒ«á·|¦A»P±z¦^´_¡A

«D±`·PÁ±zªº­@¤ß¸Ñµª¡AÁÂÁÂ

TOP

¦^´_ 2# samwang

±z¦n¡A±zªºµ{¦¡½X¥i¥H¨Ï¥Î¡A«D±`·PÁ±z¡A¥t¥i½Ð±Ð±z¬õ¦â¨º´X¦Cªº·N«ä¶Ü ?

Sub tt()
Dim xD, Arr, i&, j%, N&
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([¨BÆJ¤@!V1], [¨BÆJ¤@!A65536].End(3))
    For i = UBound(Arr) To 1 Step -1
        If Not xD.Exists(Arr(i, 1)) Then
            N = N + 1
            xD(Arr(i, 1)) = N
            For j = UBound(Arr, 1) To 1
                Arr(N, j) = Arr(i, j)

            Next
        End If
    Next
Range("A1").Resize(UBound(Arr), UBound(Arr, 1)) = ""
Range("A1").Resize(N, UBound(Arr, 1)) = Arr

End Sub

TOP

¦^´_ 1# lilizzzz

±q²Ä¤@¦C©Î³Ì«á¤@¦C¶}©l³£¥i¥H
®É¶¡0.07=>0.003

    Sub test()

Dim dr As String
Application.Calculation = xlCalculationManual
Application.ScreenUpdating = False
Application.DisplayStatusBar = False
Application.EnableEvents = False

Sheets("¤u§@ªí1").Select
Range("A2").Select

Set dic = CreateObject("scripting.dictionary")
For i = Range("A2000").End(3).Row To 1 Step -1
If dic.exists(Cells(i, "A").Value) Then
dr = dr & i & ":" & i & ","
Else
dic(Cells(i, "A").Value) = ""
End If
Next i

dr = Left(dr, Len(dr) - 1)
Range(dr).Delete Shift:=xlUp

Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
Application.DisplayStatusBar = True
Application.EnableEvents = True

End Sub

TOP

¦^´_ 1# lilizzzz

½Ð½T»{¬O§_¬°±zªº»Ý¨D¡A·PÁÂ

Sub tt()
Dim xD, Arr, i&, j%, N&
Set xD = CreateObject("Scripting.Dictionary")
Arr = Range([¤u§@ªí1!U1], [¤u§@ªí1!A65536].End(3))
    For i = 1 To UBound(Arr)
        If Not xD.Exists(Arr(i, 1)) Then
            N = N + 1
            xD(Arr(i, 1)) = N
            For j = 1 To UBound(Arr, 2)
                Arr(N, j) = Arr(i, j)
            Next
        End If
    Next
Range("A1").Resize(UBound(Arr), UBound(Arr, 2)) = ""
Range("A1").Resize(N, UBound(Arr, 2)) = Arr
End Sub

TOP

        ÀR«ä¦Û¦b : ºÉ¦h¤Ö¥»¥÷¡A´N±o¦h¤Ö¥»¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD