Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

312
Views
Remove duplicates and shift cells up

I am trying to remove duplicates, and after removing I need to shift cells up. The below works, but unfortunately it does not shift anything up. It leaves the empty rows.

Someone said to replace Columns:=Array(1) with Columns:=1, but that did not work.

Sub Macro3()
Range("A15").Select
Range(Selection, Selection.End(xlToRight)).Select
Range(Selection, Selection.End(xlDown)).Select

Selection.RemoveDuplicates Columns:=1, Header:=xlYes
End Sub
about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

It looks like you are selecting multiple columns and then only passing one column in the remove duplicates argument. Here is an example that removes more than one columns duplicates and shifts up.

ActiveSheet.Range("A:C").RemoveDuplicates Columns:=Array(1, 2, 3), Header:=xlYes

If you just want to remove one column then your code works minus the xlToRight:

Range("A15").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.RemoveDuplicates Columns:=1, Header:=xlYes
about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!