View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Kevin B Kevin B is offline
external usenet poster
 
Posts: 1,316
Default Delete all but first line

This macro is a possibility. Change the starting cell of A1 accordingly:

************************************************** **********
Sub ClearTheWay()

Dim r As Range

Set r = Range("A1").CurrentRegion

r.Range(Cells(2, 1), Cells(r.Rows.Count, _
r.Columns.Count)).Clear

Set r = Nothing

End Sub
************************************************** **********

Press Alt + F11, click INSERT on the menu and select MODULE. You can copy
and paste the macro code verbatim, excluding the lines of asterisks.
--
Kevin Backmann


"Danu" wrote:

Is there a way to easily delete all the records in a spreadsheet except for
the first line?

I have a spreadsheet with many records which must be updated each day with
new info. I can delete all the records but end up rewriting the column
titles.

Thank you.