View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default add a formula to a formula

Select the cells you want to change, then run the following code:

Sub AAA()
Dim Rng As Range
For Each Rng In Selection.SpecialCells(xlCellTypeFormulas).Cells
Rng.Formula = "=IF(ISERROR(" & Mid(Rng.Formula, 2) & _
"),""N.M""," & Mid(Rng.Formula, 2) & ")"
Next Rng
End If


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"barkiny"
wrote in message
...

i want to add to formula t

in column c1 there is a formula

=a1/b1 (let say formula is: x)

but x gives error (division by zero) in some cells

i want to add

=IF(ISERROR(FORMULA A);"N.M.";(FORMULA A))

is this possible

it will be too difficult maybe impossible for me to write every
cell
different formulas
(the formula not the same in that whole worksheet)


--
barkiny
------------------------------------------------------------------------
barkiny's Profile:
http://www.excelforum.com/member.php...o&userid=20397
View this thread:
http://www.excelforum.com/showthread...hreadid=492690