How to delete blank rows in excel using VBA?
How to delete blank rows in excel using VBA?
Welcome to VBAX Alqahtanir. You could try the following code
Public Sub DeleteBlankRows() Dim SourceRange As Range Dim EntireRow As Range Set SourceRange = Application.Selection If Not (SourceRange Is Nothing) Then Application.ScreenUpdating = False For I = SourceRange.Rows.Count To 1 Step -1 Set EntireRow = SourceRange.Cells(I, 1).EntireRow If Application.WorksheetFunction.CountA(EntireRow) = 0 Then EntireRow.Delete End If Next Application.ScreenUpdating = True End If End Sub
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link