Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
#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
Posted to microsoft.public.excel.programming
|
|||
|
|||
#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
Posted to microsoft.public.excel.programming
|
|||
|
|||
#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
Posted to microsoft.public.excel.programming
|
|||
|
|||
#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
Posted to microsoft.public.excel.programming
|
|||
|
|||
#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
Posted to microsoft.public.excel.programming
|
|||
|
|||
#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 |
Display Modes | |
|
|