add a formula to a formula

  • Thread starter Thread starter barkiny
  • Start date Start date
B

barkiny

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 cel
different formulas
(the formula not the same in that whole worksheet
 
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" <[email protected]>
wrote in message
news:[email protected]...
 

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