Does anyone know how I can delete empty rows using VBA?
Thanks in advance.
Does anyone know how I can delete empty rows using VBA?
Thanks in advance.
Link should help
http://www.ozgrid.com/VBA/VBACode.htm
VBA Noob
_________________________________________
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
THanks for your reply, but that code isn't working for me. I am using the following code from the example:
Sub DeleteBlankRows2() 'Deletes the entire row within the selection if _ some of the cells WITHIN THE SELECTION contain no data. On Error Resume Next Selection.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete On Error GoTo 0 End Sub
But I am having to step through the worksheet manually. How can I loop through this quickly?
Try
On Error Resume Next ActiveSheet.UsedRange.EntireRow.SpecialCells(xlBlanks).EntireRow.Delete
Hope that helps.
RoyUK
--------
For Excel Tips & Solutions, free examples and tutorials why not check out my web site
Free DataBaseForm example
If there are empty cells on your spreadsheet, this will delete those rows.Sub DeleteBlankRows2A() 'Deletes the entire row of any cell that contain sno data. On Error Resume Next ActiveSheet.SpecialCells(xlCellTypeBlanks).EntireRow.Delete On Error GoTo 0 End Sub
Mike
When I use your code, it doesn't do anything. Is there something that I am doing wrong?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks