3

I am stuck with something and need your help. I have a spreadsheet with 6326 Columns and 50 Rows. What I want to do is to remove duplicate from each column and calculate the number of unique elements and tally with other columns

Sub Macro1()
'
' Macro1 Macro
'

'
    Columns("G:G").Select
    ActiveSheet.Range("$G$1:$G$50").RemoveDuplicates Columns:=1, Header:=xlNo
    Range("G1").Select
End Sub

1 Answer 1

1

You can try looping through your entire range if your columns are contiguous.

With Sheets("SheetName")
    For i = 0 To 6325
        .Range("G1:G50").Offset(0, i).RemoveDuplicates Columns:=1, Header:=xlNo
    Next
End With

Suppress screen updating cause this will take a while and is costly in terms of speed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.