Clear NonDate Cells : Range Value « Excel « VBA / Excel / Access / Word






Clear NonDate Cells

 
Public Sub ClearNonDateCells()
  Dim aRange As Range
  For Each aRange In Cells.SpecialCells(xlCellTypeConstants, xlNumbers)
    If Not IsDate(aRange.Value) Then aRange.ClearContents
  Next aRange
End Sub

 








Related examples in the same category

1.Reset value in a range to zero
2.Sum the range
3.Return cell value in a range as an array
4.Change cell A1 and move to cell A2 and change it
5.Transferring one-dimensional arrays with build-in function