Having difficulties with two codes:
The point is to keep all rows that have been edited and to delete all columns that have not been edited (edited as is in -- text being changed, added or deleted). These codes work in excel, but they are not working on my attached template. I am wondering if I am missing some formatting somewhere that is causing problems? Any help is very much appreciated.
Code:
Option Explicit
Sub CleanUp()
Dim lastRow As Long
lastRow = Cells.SpecialCells(xlCellTypeLastCell).Row
Application.EnableEvents = False
'Keep all rows that have been edited
Range("Z2:Z" & lastRow).SpecialCells(xlCellTypeBlanks).EntireRow.Delete
Application.EnableEvents = True
End Sub
Sub CleanUpCols()
Dim lastCol As Long
lastCol = Cells.SpecialCells(xlCellTypeLastCell).Column
Application.EnableEvents = False
'Keep all rows that have been edited
Range("A1", Cells(1, lastCol)).SpecialCells(xlCellTypeBlanks).EntireColumn.Delete
Application.EnableEvents = True
End Sub
The point is to keep all rows that have been edited and to delete all columns that have not been edited (edited as is in -- text being changed, added or deleted). These codes work in excel, but they are not working on my attached template. I am wondering if I am missing some formatting somewhere that is causing problems? Any help is very much appreciated.