deleting rows...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I've built a template with 36 rows for users to populate - works great! BUT, they have aske if there is a way to automatically delete the rows that aren't being used. (I'm thinking a simple macro testing if A36 is populated, if not delete row, if - then end. decrement to A35... repeat until filled cell is found).

If anyone can point me in the right direction, I'd appreciate it
 
In a posting 1998-05-17 to programming newsgroup, Dana DeLouis
points out that SpecialCells frequently provides a quick method of
eliminating loops, and because SpecialCells is limited to the
UsedRange it will not be wasting time looping through the end of a
worksheet. His Example:

On Error Resume Next ' In case there are no blanks
Columns("A:A").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
ActiveSheet.UsedRange 'Resets UsedRange for Excel 97

more information about similar coding in
Delete Cells/Rows in Range, based on empty cells, or cells with specific valuesLocation:
http://www.mvps.org/dmcritchie/excel/delempty.htm



Dave Peterson said:
J.E. McGimpsey just posted a reply in this thread:
http://google.com/groups?threadm=#[email protected]
delete the rows that aren't being used. (I'm thinking a simple macro testing if A36 is populated, if not delete row, if - then end.
decrement to A35... repeat until filled cell is found).
 
Back
Top