Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Macro-Find Replace with formula

76 views
Skip to first unread message

Amy

unread,
Apr 22, 2003, 3:21:28 PM4/22/03
to
Hi,

I am trying to create a macro which would replace all
cells that have the following Hyperion Excel Retrieve
function formulas "HPVAL", "HPFNA", "HPHEA", "IF(ISERROR
(HPFNA", or "IF(ISERROR(HPVAL" with values. For the
macro, I would like the macro to go through all sheets in
the workbook and replace each of the cells with values
instead of formulas. I am not sure if I am doing tis
right. I am getting an error message. Can you please
help? Thanks in advance.

Amy

Dim WS As Worksheet
For Each WS In ThisWorkbook.Worksheets
With WS.Range("A1:AZ150")
For Each x In Selection
If Left(x.Formula, 6) = "=HPVAL" Then
x.Formula = x.Value
End If
If Left(x.Formula, 6) = "=HPFNA" Then
x.Formula = x.Value
End If
If Left(x.Formula, 6) = "=HPHEA" Then
x.Formula = x.Value
End If
If Left(x.Formula, 17) = "=IF(ISERROR(HPFNA" Then
x.Formula = x.Value
End If
If Left(x.Formula, 17) = "=IF(ISERROR(HPVAL" Then
x.Formula = x.Value
End If
End With
Next WS
End Sub

peter

unread,
Apr 22, 2003, 5:44:09 PM4/22/03
to
Hi,
I'm not sure how your macro's suppose to work, but I think
you left out a "next x" statement at the end of your code.
peter
(an old hyperion user)
>.
>
0 new messages