-
Solved: Clear worksheet except for Row 1 Macro
Can the following code be modified to not delete the Header Row (Row 1)?
This code clears the entire worksheet (Timeline Data worksheet) if there is data on it, but if it's blank (except for the Header Row 1) it will delete Row 1. I do not want it to every delete Row 1.
Thanks...
JimS
[vba]
Sub Macro12()
With ThisWorkbook.Worksheets("Timeline Data")
x = .UsedRange.Rows.Count
.Rows("2:" & x).Delete
End With
End Sub
[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules