Clear cell numbers using a macro - Help!

  • Thread starter Thread starter CAM
  • Start date Start date
C

CAM

Hello,

Thanks for Dave Peterson help I was able to to create a macro that will
clear the numbers only on the sheet, but not the formulas, below is a sample
of my code. Here is my problem I was able to clear the cells in the column -
numbers only not formulas, lets say column D, unfortuantely when I ran the
macro column C also clears, which has numbers too, but I don't want it to be
clear only column D, I selected column D to clear. How can I stop clearing
column C? any tips will be appreicated. Thank you in advance.

Cheers


Private Sub cmdClear_Click()

'Select sheet and cell range to clear inputted cells.
Sheets("Audits).Select
Range("A14:F88").Select

'Select cell type constants - inputted cells only.
Selection.SpecialCells(xlCellTypeConstants, 1).Select

'Clear cells
Selection.ClearContents

End Sub
 
Maybe...


Option explicit
Private Sub cmdClear_Click()
on error resume next
worksheets("Audits).Range("A14:F88").SpecialCells(xlCellTypeConstants, 1) _
.ClearContents
 
Back
Top