Note: The other languages of the website are Google-translated. Back to English
Log in  \/ 
x
or
x
Registe-se  \/ 
x

or

4 maneiras fáceis de remover rapidamente várias linhas em branco ou vazias no Excel

Se houver centenas de linhas em branco que precisam ser removidas de toda a planilha ou pasta de trabalho, você ficará frustrado. Aqui, este tutorial listará alguns métodos rápidos para lidar com esse trabalho para você, passo a passo.


Método A: Remova as linhas em branco com o comando Ir para especial

Agora, siga as etapas abaixo para remover linhas vazias com Ir para linhas especiais:

1. Selecione o intervalo do qual deseja remover as linhas em branco e clique em Página Inicial guia, depois em Edição grupo, clique em Encontrar e selecionar > Ir para especial.
doc delete em branco linha 2

2. No Ir para especial diálogo, verificar Blanks opção.
doc delete em branco linha 3

3. Clique OK, agora todas as células em branco na seleção foram selecionadas.
doc delete em branco linha 4

4. Clique Página Inicial guia, no Células grupo, clique em Excluir > Excluir linhas de folha.
doc delete em branco linha 5

Agora, as linhas com células em branco foram removidas.
doc delete em branco linha 6

Observação:

Há um fluxo fatal enquanto você usa o comando Ir para especial para excluir linhas em branco:
Todas as linhas contêm células em branco (mesmo se a linha contiver uma célula em branco e outras colunas contiverem dados) serão removidas conforme a imagem mostrada abaixo.

doc delete em branco linha 1


Quer Aumentar o Salário e Muito Tempo para Acompanhar a Família?

Guia Office aumenta sua eficiência em 50% no Microsoft Office trabalhando agora

Inacreditável, trabalhar com dois ou mais documentos é mais fácil e rápido do que trabalhar com um.

Em comparação com navegadores conhecidos, a ferramenta com guias no Office Tab é mais poderosa e mais eficiente.

Reduza centenas de cliques do mouse e digitação no teclado todos os dias para você, diga adeus à mão do mouse agora.

Se você costuma trabalhar com vários documentos, o Guia do Office será uma grande economia de tempo para você.

Avaliação gratuita de 30 dias, sem necessidade de cartão de crédito.

Saiba MaisFaça o download


Método B: Remover linhas em branco no intervalo / planilha / pasta de trabalho com o Kutools

Se você deseja remover rápida e facilmente todas as linhas em branco na seleção, planilha ativa, planilhas selecionadas ou toda a pasta de trabalho sem qualquer exclusão errada, você pode tentar o Excluir linhas em branco ferramenta de Kutools for Excel, que pode lidar com tarefas com um clique, sem código VBA e coluna auxiliar.

No entanto, antes de usar esta ferramenta, você precisa instalação gratuita do Kutools para Excel primeiramente.

Clique Kutools > Excluir > Excluir linhas em brancoe, na lista suspensa de sub, escolha uma operação conforme necessário.
doc delete em branco linha 17

Demonstração: Remova todas as linhas em branco com apenas um clique


Método C: Remova as linhas em branco com o código VBA

1. Pressione Alt + F11 chave para habilitar Microsoft Visual Basic para Aplicações janela.

2. Clique inserção > Módulo para criar um novo Módulo script, copie e cole o código abaixo no script.

VBA: remover linhas vazias

Sub DeleteBlankRows()
'Update 20190107
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
xRows = WorkRng.Rows.Count
Application.ScreenUpdating = False
For I = xRows To 1 Step -1
    If Application.WorksheetFunction.CountA(WorkRng.Rows(I)) = 0 Then
        WorkRng.Rows(I).EntireRow.Delete XlDeleteShiftDirection.xlShiftUp
    End If
Next
Application.ScreenUpdating = True
End Sub

doc delete em branco linha 7

3. Pressione F5 para executar o código e, em seguida, selecione um intervalo que você usa para remover linhas em branco no popping KutoolsforExcel diálogo.
doc delete em branco linha 8

4. Clique OK. Agora as linhas vazias na seleção foram removidas.
doc delete em branco linha 9

Observação:

Com esse código VBA, é melhor remover as linhas em branco de um intervalo, mas não de toda a planilha, ou o Microsoft Excel pode travar.


Método D: Remova as linhas em branco com a coluna auxiliar e a função de filtro

1. Insira uma coluna antes de seu intervalo de dados, insira a coluna A como instância e digite esta fórmula = B3 e C3 e D3 em A3 para combinar dados na linha 3, consulte a captura de tela:

Ponta: Se seus dados da coluna B3 para a coluna N, ajuste a fórmula para = B3 & C3 & D3 & E3 &… & N3.
doc delete em branco linha 10

2. Em seguida, preencha a fórmula até as células arrastando a alça de preenchimento automático para baixo.
doc delete em branco linha 11

3. Então clique Dados > filtros.
doc delete em branco linha 12

4. Em seguida, clique no Ícone de filtro na coluna auxiliar, verifique Blanks opção apenas na lista suspensa. Veja a imagem:
doc delete em branco linha 13

5. Clique OK, todas as linhas em branco foram filtradas.
doc delete em branco linha 14

6. Selecione as linhas filtradas e clique em Página Inicial > Excluir > Excluir linhas de folha para remover as linhas em branco.
doc delete em branco linha 15

7. Então clique Dados > filtros novamente para desativar filtros função.
doc delete em branco linha 16

Nota:

Compare com o método A e o método C, este método pode remover exatamente linhas em branco e é fácil de manusear para todos os usuários do Excel. No entanto, se houver dezenas de colunas em seus dados, esse método será um pouco tedioso.


Operação relativa: inserir linhas em branco a cada duas linhas

Talvez em alguns momentos, você queira inserir linhas em branco em todas as outras linhas de um intervalo, como mostrado a seguir:
doc delete em branco linha 18

Neste caso, você pode aplicar o Inserir linhas e colunas em branco utilitário do Kutools para Excel para lidar rapidamente com este trabalho.

1. Selecione o intervalo em que deseja inserir linhas ou colunas em branco em linhas alternadas e clique em Kutools > inserção > Inserir linhas e colunas em branco.
doc delete em branco linha 19

2. No Inserir linhas e colunas em branco diálogo, verificar Linhas em branco or Colunas em branco opção que você precisa em Tipo de inserção seção, então, em Opções seção, especifique o Intervalo de e Linhas/colunas.
doc delete em branco linha 20

3. Clique Ok, linhas em branco foram inseridas em todas as outras linhas da seleção.

Demonstração: inserir linhas e colunas em branco


Baixar arquivo de amostra

amostraClique para baixar o arquivo de amostra


As melhores ferramentas de produtividade para escritório

O Kutools for Excel resolve a maioria dos seus problemas e aumenta sua produtividade em 80%

  • armadilha para peixes: Insira rapidamente fórmulas complexas, gráficos e qualquer coisa que você tenha usado antes; Criptografar células com senha; Criar lista de discussão e enviar emails ...
  • Super Formula Bar (edite facilmente várias linhas de texto e fórmula); Layout de leitura (ler e editar facilmente um grande número de células); Colar na faixa filtrada...
  • Mesclar células / linhas / colunas sem perder dados; Dividir o conteúdo das células; Combinar linhas / colunas duplicadas... Evite células duplicadas; Comparar intervalos...
  • Selecione Duplicado ou Único Linhas; Selecione linhas em branco (todas as células estão vazias); Super Find e Fuzzy Find em muitos livros; Seleção aleatória ...
  • Cópia exata Várias células sem alterar a referência da fórmula; Criação automática de referências para várias folhas; Inserir marcadores, Caixas de seleção e mais ...
  • Extrair Texto, Adicionar texto, remover por posição, Remover Espaço; Criar e imprimir subtotais de paginação; Converter entre conteúdo de células e comentários...
  • Super Filtro (salvar e aplicar esquemas de filtro a outras planilhas); Classificação Avançada por mês / semana / dia, frequência e mais; Filtro Especial por negrito, itálico ...
  • Combine pastas de trabalho e planilhas; Mesclar tabelas com base em colunas-chave; Divida os dados em várias folhas; Conversão em lote de xls, xlsx e PDF...
  • Mais de 300 recursos poderosos. Suporta Office / Excel 2007-2019 e 365. Suporta todos os idiomas. Fácil implantação em sua empresa ou organização. Teste gratuito de 30 dias com recursos completos. Garantia de devolução do dinheiro em 60 dias.
guia kte 201905

Guia do Office traz interface com guias para o Office e torna seu trabalho muito mais fácil

  • Habilite a edição e leitura com guias em Word, Excel, PowerPoint, Publisher, Access, Visio e Project.
  • Abra e crie vários documentos em novas guias da mesma janela, em vez de em novas janelas.
  • Aumenta sua produtividade em 50% e reduz centenas de cliques do mouse para você todos os dias!
officetab bottom
Say something here...
symbols left.
You are guest
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    rs poshwal jaipur · 4 years ago
    VERY NICE, THANKS
  • To post as a guest, your comment is unpublished.
    YC · 4 years ago
    :lol: Good to share! Thank you!
  • To post as a guest, your comment is unpublished.
    Sudhakar · 4 years ago
    Very Helpful :-) it helped me to reconcile big report.
  • To post as a guest, your comment is unpublished.
    MEL · 4 years ago
    Guys I recently had this issue. I realised that the F5 special blanks wouldn't work because some of my columns had merged data sharing some rows...

    I just selected the columns needed and make sure the merge button was unselected. From there, the F5 special blanks select worked!
    Hope it helps someone.
  • To post as a guest, your comment is unpublished.
    Sanjay Rajput · 5 years ago
    This is simple VBA code to delete the entire rows based on particular column:-

    Sub DeleletBlankrows()
    Range("A1:A10000").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    End Sub
  • To post as a guest, your comment is unpublished.
    nigel · 5 years ago
    only usefull if you want to delete ANY row with ONE blank cell, not delete rows with ALL cells being blank.
    Isn't this titled "How to remove blank or empty rows in Excel?" not "How to remove rows with blank cells?"
    • To post as a guest, your comment is unpublished.
      W. HALYN · 4 years ago
      Ah, no, actually. The whole purpose of the sort & filter routine I demonstrated is to take out ONLY rows that are entirely blank across.
      The inquirer did not want any row removed that had some data in it... only rows that were completely blank. And the problem with the BLANK command was that it took out ANY rows [b]entirely[/b] that had even one blank cell, erasing the rest of the data on the same row.
      Try it. It does the opposite of what you stated in your first sentence.... it takes out [u][i]only entire blank rows[/i][/u], and leaves ALL the remaining data intact.
      • To post as a guest, your comment is unpublished.
        Tom · 4 years ago
        When you select multiple columns, then go to Find & Select -> Go To Special and choose blanks, it will highlight every blank cell within that range. If you then proceed to Delete -> Delete Sheet Rows, it will delete all rows that had a blank cell selected. Go try it.
  • To post as a guest, your comment is unpublished.
    sohail · 6 years ago
    oh bro thankyou very very much .....
  • To post as a guest, your comment is unpublished.
    s · 6 years ago
    thanks a lot, it saved lot of time
  • To post as a guest, your comment is unpublished.
    Lily Podjan · 6 years ago
    Thank You very much !!!

    It's really great help me :D
  • To post as a guest, your comment is unpublished.
    Kanchan Mudgal · 6 years ago
    This really helped me in my testing activity. Thank you very much
  • To post as a guest, your comment is unpublished.
    Adel · 6 years ago
    THANK YOU!! That was really helpful
  • To post as a guest, your comment is unpublished.
    CJ Sandham · 6 years ago
    I have a spreadsheet which list 200 different problems in row 2, in row 1 there is an index, 1.1, 1.2, 1.3, 1.4, 2.1, 2.2 etc etc.
    I then have in row 3 4 and 5 the choice of, no action, low action and high action.
    I review the problems and enter an "x" in the appropriate column.
    I want to make a condensed list of only the items with an "x" in the high action column but I also need to keep the complete spreadsheet so can just filter.

    is there a reference/index/lookup type function I can use?
  • To post as a guest, your comment is unpublished.
    sadiq · 7 years ago
    it very nice is use full for me
  • To post as a guest, your comment is unpublished.
    Darko Loncar · 7 years ago
    It doesnt work for me. I am using EXCEL 2013 and have this situation : my data are in range A1 to P2373. When I click
    Ctrl-End I come to cell AW7335. So I have all blank rows from 2374 to 7335.

    So, what for is Ctrl-End?
    I can upload my file so anybody can delete blank rows for me.
    • To post as a guest, your comment is unpublished.
      Ashwani Bahuguna · 7 years ago
      OK .
      ashwanibahuguna@gmail.com
    • To post as a guest, your comment is unpublished.
      Ashwani Bahuguna · 7 years ago
      ok.

      i can try

      [quote name="Darko Loncar"]It doesnt work for me. I am using EXCEL 2013 and have this situation : my data are in range A1 to P2373. When I click
      Ctrl-End I come to cell AW7335. So I have all blank rows from 2374 to 7335.

      So, what for is Ctrl-End?
      I can upload my file so anybody can delete blank rows for me.[/quote]
      Ashwani
  • To post as a guest, your comment is unpublished.
    ashwani · 7 years ago
    very easy way if you want to delete blank rows. go to first column insert a new column and fill the series, then go to filter option and now in next column select blank. its the very easy way to remove or delete blank rows
  • To post as a guest, your comment is unpublished.
    Gajeswari · 7 years ago
    Thank you So much very useful
  • To post as a guest, your comment is unpublished.
    raj · 7 years ago
    thank you it helped me
  • To post as a guest, your comment is unpublished.
    Ahmad H. · 7 years ago
    Great tips, so helpful
  • To post as a guest, your comment is unpublished.
    Karthik · 7 years ago
    Hi,

    If i follow above the procedure, getting error message as 'Selection is too large'. Then how to remove empty cells for large list.
    • To post as a guest, your comment is unpublished.
      W. Halyn · 7 years ago
      [quote name="Karthik"]Hi,
      If i follow above the procedure, getting error message as 'Selection is too large'. Then how to remove empty cells for large list.[/quote]

      The first thing I would try is selecting half the database, or a quarter. If that works, repeat on remaining sections. If it does not, see if your computer has enough RAM available for processing such a large chunk of data. Without actually seeing the file, it's hard to say.
  • To post as a guest, your comment is unpublished.
    nanda · 7 years ago
    Its awsome it was very help full for me thanks a lot.
  • To post as a guest, your comment is unpublished.
    khachedu lal · 7 years ago
    great suggestion...............
    thanks :lol:
  • To post as a guest, your comment is unpublished.
    KennKelley · 7 years ago
    W. Halyn: your solution worked perfectly for me. Using Excel 2007 and 2013.
  • To post as a guest, your comment is unpublished.
    guru · 7 years ago
    Deleting the blank rows using the special command "Blank" doesnt work correctly in case i have multiple rows and multiple columns with some blank columns in between.The operation is deleting the rows with data and providuing the unexpected result.
    Example : Columns : A to F having 5 rows of data as follows . When we do the blank operation we get unexpected reults (result doesn't show 5 rows..!!)

    A B C D E F
    Check1 Check2 Check3 Check4 Check6 Check7

    Check1 Check2 Check3 Check4 Check7



    Check1 Check2 Check3 Check4 Check7


    Check1 Check2 Check3 Check4 Check6 Check7

    Check1 Check2 Check3 Check4 Check6 Check7


    any idea , why?
  • To post as a guest, your comment is unpublished.
    Dana FitzGerald · 7 years ago
    Nice tutorial
    --helped me greatly! Thanks!
  • To post as a guest, your comment is unpublished.
    outofmyleague · 7 years ago
    Can you turn all of this into a macro that could be executed at the bottom of a spreadsheet when the data is fished being collected?
  • To post as a guest, your comment is unpublished.
    mzmolek1 · 7 years ago
    I tried this but when I used Kutools function: delete tools > In Selected Range I get message: "Successfully deleted 0 rows" and nothing changes.
    • To post as a guest, your comment is unpublished.
      W. Halyn · 7 years ago
      Instead of using Kutools, try the method I described above. It uses plain old Excel, using the features available in all recent versions.
      (That's if you're trying to delete ONLY [u]all-blank[/u] rows, not partially-blank ones.)
      • To post as a guest, your comment is unpublished.
        outofmyleague · 7 years ago
        can you just do all of this with a macro to be executed at the bottom of a sheet once all the data is collected and analyzed? I am doing an "IF/THEN" analysis for some folks and sin=ce that works automatically the above solution, while elegant, may be beyond their capacity(maybe mine too ...) So, once the data is completed I was looking to point then to a cell and click "go" and the blank rows would be eliminated ..... any ideas?
        • To post as a guest, your comment is unpublished.
          W. Halyn · 7 years ago
          It would take about ten times longer to write such a macro (which would have to auto-calc total columns, total vertical fill in ALL columns, then calc which column to do the counts in, then execute the operation, etc.) than to just do the steps.
          Really, the whole operation takes less than two minutes if you read over the instructions step by step. Maybe try displaying steps side-by-side with the work you're doing (or print the steps out, then follow along). Once you see it work the first time, you'll feel a lot more comfortable with it, and you'll definitely be wiser in the operation of the Filter function.
          Re the folks you're doing the work for, just bring them the results; they probably don't care "how", they just wanna know "what". A quickly-cleaned-up database will look more impressive than watching how it got that way, especially if you're just learning how. Give it a practice run or two. Oh, and make a backup copy, of course, just in case Undo fails or something while trying it out.
          (Mind you, at your first query, I envisioned a macro that would have to work in all environments. What YOU would find is that once you've got a fixed-structure data set going, you'll know exactly how the procedure works and could just record steps into a macro of your own, just for the speed factor.)
  • To post as a guest, your comment is unpublished.
    Darko Loncar · 7 years ago
    I can't delete. I am using Excel 2010 and I want to delete blank rows from A147533 to (after ctrl - End) T448140.

    What ever i did all rows stay undeleted in my spreadsheet. After ctrl-End I am again at T448140.
    • To post as a guest, your comment is unpublished.
      W. Halyn · 7 years ago
      Darko.
      Your first step in the extra column (which should be "U" column for the filtering), the formula in U147533 should read (judging from your supplied data) =COUNTA(A147533:T147533) and then COPY that down to row 448140. You should get a column of numbers, SOME of which will be zeroes.
      Then click on the "U" letter at the top of the column (in the ruler margin) to highlight the entire column.
      Then select the Filter function (Data tab, Filter), click on the little pull-down triangle, and delete all the checkmark choices except the one beside the "0" choice (OR the "Blanks" choice, if visible). Click on OK.
      You should then see only rows that have zero data in them.

      Then as described previously, with the Filter function still active, highlight the rows from 147533 to 448140 that are containing those selected row numbers (by clicking/dragging down the left ruler margin OR clicking top one and shift-clicking last one), and DELETE them. (Right-click, Delete).
      When they vanish, turn the Filter function off and all other data will reappear.
      Good luck!
      • To post as a guest, your comment is unpublished.
        Darko Loncar · 7 years ago
        It doesnt work for me. Now I am using EXCEL 2013 and have this situation : my data are in range A1 to AF52222. When I click
        Ctrl-End I come to cell AG56367. So I have all blank rows from 52223 to 56367.
        After COUNTA(a2;af2) copied to row 56367 and highlighting rows 52223 to 56376 on Right-click EXCEL offers DELETE ROW and I deleted this rows.
        After that I turn off Filter: with Ctrl-Home I come to cell A1, with Crtl-End I come to cell AG56367. So all was the same
  • To post as a guest, your comment is unpublished.
    Jay · 7 years ago
    This is Cool!!! @ # W. Halyn. Thank You.
  • To post as a guest, your comment is unpublished.
    Wasamut · 7 years ago
    The visual basic route was new to me and did the trick. Many thanks!
  • To post as a guest, your comment is unpublished.
    Daysha · 7 years ago
    You've just saved my life. :-)
  • To post as a guest, your comment is unpublished.
    Ned · 7 years ago
    This is awesome.

    Thank you very very very much

    Ned
  • To post as a guest, your comment is unpublished.
    zahra · 7 years ago
    Thank you very much for the advice. It was great.
  • To post as a guest, your comment is unpublished.
    W. Halyn · 7 years ago
    "Blank rows deletion" is awkward by most methods. I had a set of three columns of data. The first column had title lines every five or six rows. The remaining two columns had random data at various rows all the way down. Sometimes a row in column two was blank, but the cell beside it in column three had data. Or vice versa.
    Only SOME of the rows (1,242 in this case) were blank all the way across.
    The PROBLEM was that selecting BLANK cells would DELETE ENTIRE ROWS that had data in other columns.
    I found a perfect solution.

    I created a fourth column in which I used the COUNTA function.
    The formula went =COUNTA(A1:C1) and then copied it down thru several thousand rows of data.
    So, my D column had a stack of 3s,2s,1s & 0s.
    Then I used the FILTER command on Column D to only show the rows that equalled 0. The result was a sheet of empty cells with 0s in column D... ONLY the totally blank rows had been selected!
    Then I clicked and dragged down the left-side ROW NUMBERS (those in the margin) to select those rows, right-clicked and selected DELETE. They all vanished.
    When I turned OFF the filter, I had a perfect set of cleaned data.
    In less than a minute! Done!
    = = = = = = =
    That was so easy, I then got fancy and changed the COUNTA function to only select items from the A column that had data in them. (Those rows happened to be "Title" rows for clumps of data below them.) It read =COUNTA(A1) and copied IT down the D column to the end. The result was a column of 1s and 0s.
    When I turned FILTER on again and selected for "1", only the Title rows appeared. I selected those rows and BOLDed them. Then turned the Filter off, and again, perfect formatting down thru thousands of lines.
    LOVE THAT FILTER FUNCTION!
    • To post as a guest, your comment is unpublished.
      RAj · 5 years ago
      Great some time Users provide more practical solution than developers and experts
    • To post as a guest, your comment is unpublished.
      keyur · 5 years ago
      great help this filter function is best solution if we think and use it
    • To post as a guest, your comment is unpublished.
      DatabaseMN · 6 years ago
      Excellent - perfect simple solution.
    • To post as a guest, your comment is unpublished.
      Uttam · 7 years ago
      Perfect solution, it just worked out seamlessly.
      Thanks :-)
    • To post as a guest, your comment is unpublished.
      Alan · 7 years ago
      This is genius - thank you!
    • To post as a guest, your comment is unpublished.
      Ashik · 7 years ago
      Great, Thank you very much
    • To post as a guest, your comment is unpublished.
      Tony_L · 7 years ago
      This is a great solution, thanks!
  • To post as a guest, your comment is unpublished.
    ejohns74 · 8 years ago
    When I do this, the text gets deleted. Help please.
    • To post as a guest, your comment is unpublished.
      W. Halyn · 7 years ago
      Don't know if you've solved the issue about additional text getting deleted, but I've posted a solution to what might be your problem.
      It's listed below your question.