#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 361
Default Modify a Macro

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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I email amacro? leo Excel Worksheet Functions 24 August 9th 06 02:47 PM
Macro question Chris Excel Worksheet Functions 12 July 7th 06 01:23 AM
Editing a simple macro Connie Martin Excel Worksheet Functions 5 November 29th 05 09:19 PM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Highlight Range - wrong macro, please edit. Danny Excel Worksheet Functions 8 October 19th 05 11:11 PM


All times are GMT +1. The time now is 07:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"