Advertisement
oshkoshbagoshh

deleteemptyrows

Aug 18th, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub DeleteEmptyRows()
  2.     SelectedRange = Selection.Rows.Count
  3.     ActiveCell.Offset(0, 0).Select
  4.     For i = 1 To SelectedRange
  5.         If ActiveCell.Value = "" Then
  6.             Selection.EntireRow.Delete
  7.         Else
  8.             ActiveCell.Offset(1, 0).Select
  9.         End If
  10.     Next i
  11. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement