J
johnsr4
(Excel 2003) Can anyone help with a quick macro I have that is giving
me an error?
The purpose of the macro is to find all formulas on a page (range) and
increment the Column by 1. The error is on the line "cel.formula =
prefix & cel.formula & sufix"
The formulas I am changing are all references to another worksheet. Is
the problem that the formula contains an equal sign in it?
Any help is GREATLY appreciated!
Thanks
-John
--------------------------------------------------------------------------------
Sub EditFormula()
Dim Cel As Range
Dim Sufix As String
Dim Prefix As String
Prefix = "=Offset("
Sufix = ", 0, 1)"
For Each Cel In Selection
If Cel.HasFormula Then _
Cel.Formula = Prefix & Cel.Formula & Sufix
End If
Next Cel
End Sub
me an error?
The purpose of the macro is to find all formulas on a page (range) and
increment the Column by 1. The error is on the line "cel.formula =
prefix & cel.formula & sufix"
The formulas I am changing are all references to another worksheet. Is
the problem that the formula contains an equal sign in it?
Any help is GREATLY appreciated!
Thanks
-John
--------------------------------------------------------------------------------
Sub EditFormula()
Dim Cel As Range
Dim Sufix As String
Dim Prefix As String
Prefix = "=Offset("
Sufix = ", 0, 1)"
For Each Cel In Selection
If Cel.HasFormula Then _
Cel.Formula = Prefix & Cel.Formula & Sufix
End If
Next Cel
End Sub