View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default macro stopped working after upgrade to 2007

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.

mohavv wrote:

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


--

Dave Peterson