You can define a macro containing the following code:
Sub DeleteA5X50() Range("A5:X50").Select Selection.ClearContents end sub
Running the macro will select the A5: x50 range on the active sheet and clear all the contents of the cells within that range.
To leave your formulas unchanged, use:
Sub DeleteA5X50() Range("A5:X50").Select Selection.SpecialCells(xlCellTypeConstants, 23).Select Selection.ClearContents end sub
First, you select the general range of cells that you are interested in clearing the contents of, and then further restrict the selection to only include cells that contain what, according to excel, are “constants”.
You can do this manually in excel by selecting a range of cells, pressing "f5" to open the "Go To" dialog box, then click on the "Special" button and select the "Constants" option and click "OK '.
source share