I am working in Excel (not 2007) and am trying to get a Macro that will run and select all Cells in a Worksheet except for the first row. What I have so far is this:
I do want the command to clear the entire sheet so that it can have more data imported to it.
I get a compile error that selects the ".Cells" portion of the code.
Any ideas? Should I be doing this differently?
Code:
Dim LR As Long
LR = .Cells(Rows.Count, 1).End(xlUp).Row + 1
Sheets("M").Activate
Range("A2:T" & LR).Select
Selection.Delete
I do want the command to clear the entire sheet so that it can have more data imported to it.
I get a compile error that selects the ".Cells" portion of the code.
Any ideas? Should I be doing this differently?