Modify a Macro

C

carl

Thanks Bob P for this.

Is it possible to modify this so that it also turns the formula to value if
the cell is not equal to 0 or the formula returns an error like
#NT/FND,#NUM!, #N/A etc.

Sub changetoval()
For Each cella In Range("m18:m1000") 'ADJUST RANGE!
If cella <> 0 Then
cella.Value = cella.Value
End If
Next cella
End Sub

Thank you in advance.
 
B

Bob Phillips

Sub ChangeToVal()
For Each cella In Range("M18:M1000") 'ADJUST RANGE!
If IsError(cella.Value) Then
cella.Value = ""
ElseIf cella.Value <> 0 Then
cella.Value = cella.Value
End If
Next cella
End Sub


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
Top