اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

الردود الموصى بها

قام بنشر
Sub Test()
    Dim ws As Worksheet, lr As Long, r As Long, m As Long
    Application.ScreenUpdating = False
        Set ws = ThisWorkbook.Sheets.Add(After:=ThisWorkbook.Sheets(ThisWorkbook.Sheets.Count))
        m = 1
        With Worksheets(1)
            lr = .Cells(Rows.Count, 1).End(xlUp).Row
            With .Range("B1:B" & lr)
                .Formula = "=COUNTIF($A$1:A1,A1)"
                .Value = .Value
            End With
            For r = lr To 1 Step -1
                If .Cells(r, 2).Value > 1 Then
                    ws.Cells(m, 1).Value = .Cells(r, 1).Value
                    m = m + 1
                    .Rows(r).Delete
                End If
            Next r
            .Columns(2).ClearContents
        End With
        If m = 1 Then
            Application.DisplayAlerts = False
                ws.Delete
            Application.DisplayAlerts = True
        End If
    Application.ScreenUpdating = True
    If m > 1 Then MsgBox "Names Moved = " & m - 1, 64 Else MsgBox "No Change", 64
End Sub

 

  • Like 2

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information