rafael.cadina
New Member
- Joined
- Aug 30, 2011
- Messages
- 4
I created a macro to delete blank rows in my sheets. When i run it in debug mode via F8 (step-by-step) it works perfect. The thig is when i run it via F5 (play) some rows are not deleted in the process. Just below is my code. Does anybody can help me out? Thanks in advance
Code:
Sub Excluir_Linhas_Em_Branco() 'Exclui todas as linhas em branco
Coluna_Base = "B"
Linha_Final = Cells(Rows.Count, Coluna_Base).End(xlUp).Row
Dim rng As Range
Set rng = Range(Coluna_Base & "2:" & Coluna_Base & Linha_Final)
For Each c In rng.Cells
If IsEmpty(c) = True Then
c.EntireRow.Delete
End If
Next c
End Sub