ItalianPlatinum
Well-known Member
- Joined
- Mar 23, 2017
- Messages
- 770
- Office Version
- 365
- 2019
- Platform
- Windows
I found this VBA code on this site. but it doesn't work. and was hoping if someone could assist me as to why
I am looking to delete all rows below the last row of data in column A. I noticed my excel creates many unused rows after my other code runs.
I am looking to delete all rows below the last row of data in column A. I noticed my excel creates many unused rows after my other code runs.
VBA Code:
Dim bottomrow, lastblank As Long
bottomrow = Workbooks("Compare").Sheets("Periodic").UsedRange.rows.count
lastblank = Workbooks("Compare").Sheets("Periodic").Cells(rows.count, 1).End(xlUp).row + 1
Range("A" & lastblank & "A" & bottomrow).EntireRow.Delete