I am using this public function to clean my worksheet of unneeded data after a macro has run. Problem is that if there are no results for it to clean it removes row 1. Is there a line of code I can add so that it will never clear out row 1?
[/quote]
Code:
Public Function CleanSheet()
LastRow = Range("A" & Rows.Count).End(xlUp).Row
Rows("2:" & LastRow).Select
Selection.ClearContents
Range("A1").Select
End Function