Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

314
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda