Modify a Macro

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top