Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 68
Default macro stopped working after upgrade to 2007

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Networkdays Stopped Working - Again Steve Excel Worksheet Functions 9 August 18th 07 03:02 AM
2007 Upgrade wont run macro BrianW Excel Discussion (Misc queries) 0 June 26th 07 04:44 AM
Why have my Excel Macro Shortcuts stopped working? Mac Excel Worksheet Functions 0 November 6th 05 12:42 AM
VB Stopped Working [email protected] Excel Worksheet Functions 1 April 28th 05 01:56 PM
excel stopped working Steve Excel Discussion (Misc queries) 0 January 13th 05 04:07 AM


All times are GMT +1. The time now is 05:09 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"