#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default #div/0!

With the data I have, there isn't always going to be a
value to divide by hence the #div/0! error. If I use the
if(iserror(),"",()) method, I'd have to re-input the
formula for every cell that does calculations. The data
is collected from a workbook that is multipaged with
named tabs thus making it a bit tedious to use the
formula in every cell (long tab names). Is there a way
to use a macro or something of that nature to fix this
issue on a large scale rather than one by one?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default #div/0!

Tamesh,
if #div/0! error is in a cell with formulas use
Range("A1").Select
Selection.SpecialCells(xlCellTypeFormulas, 16).Select
Selection.ClearContents

if you have done copy and paste special values then
Range("A1").Select
Selection.SpecialCells(xlCellTypeConstants, 16).Select
Selection.ClearContents
HTH
Cecil

"Tamesh" wrote in message
...
With the data I have, there isn't always going to be a
value to divide by hence the #div/0! error. If I use the
if(iserror(),"",()) method, I'd have to re-input the
formula for every cell that does calculations. The data
is collected from a workbook that is multipaged with
named tabs thus making it a bit tedious to use the
formula in every cell (long tab names). Is there a way
to use a macro or something of that nature to fix this
issue on a large scale rather than one by one?




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default #div/0!

Cecil, exactly what does the code you just gave me do?
Thx for the help.
-----Original Message-----
Tamesh,
if #div/0! error is in a cell with formulas use
Range("A1").Select
Selection.SpecialCells(xlCellTypeFormulas, 16).Select
Selection.ClearContents

if you have done copy and paste special values then
Range("A1").Select
Selection.SpecialCells(xlCellTypeConstants,

16).Select
Selection.ClearContents
HTH
Cecil

"Tamesh" wrote in message
...
With the data I have, there isn't always going to be a
value to divide by hence the #div/0! error. If I use

the
if(iserror(),"",()) method, I'd have to re-input the
formula for every cell that does calculations. The

data
is collected from a workbook that is multipaged with
named tabs thus making it a bit tedious to use the
formula in every cell (long tab names). Is there a way
to use a macro or something of that nature to fix this
issue on a large scale rather than one by one?




.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default #div/0!

Have you tried Search & Replace for the text of the formula?

"Tamesh" wrote in message
...
With the data I have, there isn't always going to be a
value to divide by hence the #div/0! error. If I use the
if(iserror(),"",()) method, I'd have to re-input the
formula for every cell that does calculations. The data
is collected from a workbook that is multipaged with
named tabs thus making it a bit tedious to use the
formula in every cell (long tab names). Is there a way
to use a macro or something of that nature to fix this
issue on a large scale rather than one by one?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default #div/0!

I tried that but I kept getting the message that my
search string could not be found (original value of cell)


-----Original Message-----
Have you tried Search & Replace for the text of the

formula?

"Tamesh" wrote in message
...
With the data I have, there isn't always going to be a
value to divide by hence the #div/0! error. If I use

the
if(iserror(),"",()) method, I'd have to re-input the
formula for every cell that does calculations. The

data
is collected from a workbook that is multipaged with
named tabs thus making it a bit tedious to use the
formula in every cell (long tab names). Is there a way
to use a macro or something of that nature to fix this
issue on a large scale rather than one by one?




.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 46
Default #div/0!

Tamesh,
The code I gave you will clear the content of the cell if the formula in
that cell generates an error but I think you want to have the formula in
tact,
this code when run will change the formulas in the selection from
=The formula to
=if(iserror(The formula),"",The formula)

Sub Addiserror()
Dim cell As Range
For Each cell In Selection
If cell.HasFormula Then
cell.Formula = "=if(iserror(" & _
Replace(cell.Formula, "=", "", 1, 1, vbTextCompare) & _
"),""""," & _
Replace(cell.Formula, "=", "", 1, 1, vbTextCompare) & ")"
End If
Next cell
End Sub

HTH
Cecil

"Tamesh" wrote in message
...
Cecil, exactly what does the code you just gave me do?
Thx for the help.
-----Original Message-----
Tamesh,
if #div/0! error is in a cell with formulas use
Range("A1").Select
Selection.SpecialCells(xlCellTypeFormulas, 16).Select
Selection.ClearContents

if you have done copy and paste special values then
Range("A1").Select
Selection.SpecialCells(xlCellTypeConstants,

16).Select
Selection.ClearContents
HTH
Cecil

"Tamesh" wrote in message
...
With the data I have, there isn't always going to be a
value to divide by hence the #div/0! error. If I use

the
if(iserror(),"",()) method, I'd have to re-input the
formula for every cell that does calculations. The

data
is collected from a workbook that is multipaged with
named tabs thus making it a bit tedious to use the
formula in every cell (long tab names). Is there a way
to use a macro or something of that nature to fix this
issue on a large scale rather than one by one?




.



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



All times are GMT +1. The time now is 10:29 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"