One way:
Public Sub ClearNumbers()
On Error Resume Next
Cells.SpecialCells(xlCellTypeConstants, xlNumbers).ClearContents
On Error GoTo 0
End Sub
In article ,
chryo wrote:
Can anyone throw me a bone here.
I need to write some code to attache to a command button that will
check an entire spreadsheet and clear all numeric data. Basically the
spreadsheet is for cost analysis and we enter hours. I want to click
the button and have it clear all the hours from all cells and ignore
any text data.
Any help would be greatly appreciated.
Thanks!
---
Message posted from http://www.ExcelForum.com/