Hi,
Unfortunately when I moved jobs I lost a load of vba I had to speed up day to day workflow, I have a number of small tools that essentially 'modified' the formula that was in the existing cell(s).
I have placed an example of one below, but the bit I'm struggling with as don't use VBA as much as I used to is how I can make this tool apply it to all the cells in the currently highlighted range;
The range may be multiple columns / rows so it can't just loop down or across.
Sub Formula_Iserror()
MyOrigFormula = ActiveCell.Formula
MyFormulaPrefix = "=Iferror("
MyFormulaSuffix = ",0)"
MyOrigFormulaLen = Len(MyOrigFormula)
MyOrigFormula2 = Right(ActiveCell.Formula, MyOrigFormulaLen - 1)
MyNewFormula = MyFormulaPrefix & MyOrigFormula2 & MyFormulaSuffix
ActiveCell.Formula = MyNewFormula
End Sub
Any help really appreciated as its really slowing me down ;<
Unfortunately when I moved jobs I lost a load of vba I had to speed up day to day workflow, I have a number of small tools that essentially 'modified' the formula that was in the existing cell(s).
I have placed an example of one below, but the bit I'm struggling with as don't use VBA as much as I used to is how I can make this tool apply it to all the cells in the currently highlighted range;
The range may be multiple columns / rows so it can't just loop down or across.
Sub Formula_Iserror()
MyOrigFormula = ActiveCell.Formula
MyFormulaPrefix = "=Iferror("
MyFormulaSuffix = ",0)"
MyOrigFormulaLen = Len(MyOrigFormula)
MyOrigFormula2 = Right(ActiveCell.Formula, MyOrigFormulaLen - 1)
MyNewFormula = MyFormulaPrefix & MyOrigFormula2 & MyFormulaSuffix
ActiveCell.Formula = MyNewFormula
End Sub
Any help really appreciated as its really slowing me down ;<