dommmm
New Member
- Joined
- Feb 6, 2020
- Messages
- 10
- Office Version
- 365
- 2019
- 2016
- 2013
- Platform
- Windows
Hi,
I'm having a little problem. I'm trying to determine the last row based on any data in column J and then delete the contents of cells A2 to AZ* on that last row BUT if the sheet is blank apart from the header (ie the last row is 1), then I want it to stop as the code is deleting the column headers.
This is what I have:
lr = Cells(70000, 10).End(xlUp).Row
If lr = Cells(1, 10) Then
Exit Sub
End If
Range("A2:AZ" & lr).Select
Selection.ClearContents
Probably something so simple.
I'm having a little problem. I'm trying to determine the last row based on any data in column J and then delete the contents of cells A2 to AZ* on that last row BUT if the sheet is blank apart from the header (ie the last row is 1), then I want it to stop as the code is deleting the column headers.
This is what I have:
lr = Cells(70000, 10).End(xlUp).Row
If lr = Cells(1, 10) Then
Exit Sub
End If
Range("A2:AZ" & lr).Select
Selection.ClearContents
Probably something so simple.