Thread: Modify a Macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Modify a Macro

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)

"carl" wrote in message
...
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.