I need help with this code. I just want the contents to be cleared until the last row. This code works perfectly when I have it set to delete, but not when I have it set to ClearContents.
I need clear contents, because it is breaking formulas on cells referenced, since cells are being deleted.
Code:
Range(Range("A2"), ActiveCell.SpecialCells(xlLastCell)).Delete Shift:=xlUp
Code:
Sub ClearDetailData()Sheet1.Activate
Application.ScreenUpdating = False
Range(Range("A2"), ActiveCell.SpecialCells(xlLastCell)).ClearContents Shift:=xlUp
Application.ScreenUpdating = False
I need clear contents, because it is breaking formulas on cells referenced, since cells are being deleted.
Last edited: