Dear All,
In the below excel table I have a macro for clearing the contents of specific cells & ranges. However, I want to modify it a bit and apart from clearing the contents also to delete any inserted row above the "total bar" and keep rows 1:5.
Any help would be much appreciated.
In the below excel table I have a macro for clearing the contents of specific cells & ranges. However, I want to modify it a bit and apart from clearing the contents also to delete any inserted row above the "total bar" and keep rows 1:5.
Any help would be much appreciated.
VBA Code:
Sub ClearAll()
Range("B2", "K2").ClearContents
Range("B4", "K4").ClearContents
Range("B5", "K5").ClearContents
Range("B6", "K6").ClearContents
Range("B7", "K7").ClearContents
Range("B8", "K8").ClearContents
Range("B9", "K9").ClearContents
Range("B10", "K10").ClearContents
Range("B11", "K11").ClearContents
Range("B12", "K12").ClearContents
Range("B13", "K13").ClearContents
Range("B14", "K14").ClearContents
Range("B15", "K15").ClearContents
Range("B16", "K16").ClearContents
Range("B17", "K17").ClearContents
Range("B18", "K18").ClearContents
Range("B19", "K19").ClearContents
Range("B20", "K20").ClearContents
Range("B21", "K21").ClearContents
Range("B22", "K22").ClearContents
Range("B23", "K23").ClearContents
Range("B24", "K24").ClearContents
Range("B25", "K25").ClearContents
Range("M4", "M30").ClearContents
End Sub