S
Sub more_stuff()
Dim cRng As Range
Dim fRng As Range
Dim rng As Range
Dim adr As Variant Dim n As Integer
On Error Resume Next
Set fRng = Range("A:C").SpecialCells(xlCellTypeFormulas)
Set cRng = Range("A:C").SpecialCells(xlCellTypeConstants, xlNumbers)
On Error GoTo 0
If cRng Is Nothing And fRng Is Nothing Then
MsgBox "Your data contains neither constants nor formulas"
Exit Sub
End If
If Not cRng Is Nothing Then
MsgBox "Constants are found at: " & cRng.Address
End If
If Not fRng Is Nothing Then
MsgBox "functions are found at: " & fRng.Address
End If
adr = cRng.Address
If Len(adr) - Len(Replace(adr, ",", "")) > 0 Then
adr = Split(adr, ",")
End If
For n = 0 To UBound(adr)
With Range(adr(n))
.Value = Evaluate("IF(LEN(" & adr(n) & "),TRUNC(" & adr(n) & "),"""")")
.NumberFormat = "0.000"
End With
Next
End Sub