Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete all but first line
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. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete all but first line
One way:
Use this macro, attached to a button or keyboard shortcut: Public Sub ClearSheet With ActiveSheet .Rows("2:"&.Rows.Count).Clear End With End Sub In article , 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. |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
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. |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
Delete all but first line
Manually, you could click the "2" in the row header to select the entire row
2 and then follow that up by keying in Ctrl+Shift+{END}+{DOWN ARROW} and follow that by pressing {DELETE}. Rick "Danu" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I delete a few words from a line of text? | Excel Worksheet Functions | |||
How to delete a line segment? | Charts and Charting in Excel | |||
way to test line before / after, without !REF if delete? | Excel Discussion (Misc queries) | |||
Line delete automaticaly | Excel Discussion (Misc queries) | |||
How do I delete the line between 2 cells and merge them into one . | Excel Discussion (Misc queries) |