macro stopped working after upgrade to 2007

M

mohavv

Hi,

the following macro stpped working after upgrade to Office 2007.
I used it to get the actual formula as text.

Help is much appreciated.

Cheers,

Harold

Function GetFormula(Rng As Range)
Dim myFormula As String
GetFormula = ""
With Rng.Cells(1)
If .HasFormula Then
If Application.ReferenceStyle = xlA1 Then
myFormula = .Formula
Else
myFormula = .FormulaR1C1
End If
If .HasArray Then
GetFormula = "{=" & Mid(myFormula, 2, Len(myFormula))
& "}"
Else
GetFormula = myFormula
End If
End If
End With
End Function
 
D

Dave Peterson

My bet is that either the workbook (addin???) that you used in earlier versions
isn't being opened in xl2007 or you didn't enable macros when you opened this
file.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top