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