Works in 2003 but not 2007

  • Thread starter Thread starter M.Siler
  • Start date Start date
M

M.Siler

When I reference the below function in 2003 I get function displayed... now
in 2007 I get

#NAME?

Any idea what I need to change/set in 2007 so it will run this function?

Function formulaText(x As Range)

'returns the text equivalent of formula in upper left cell in range x
'example: =formulatext(a1) returns the formula found in cell a1 of
active worksheet
'example: =formulatext(a1:b5) returns the formula found in cell a1 of
active worksheet
formulaText = x.Cells(1, 1).Formula

End Function

Thanks,
Mark
 
Mark,

It works fine for me. Are you stored in a standard code module?

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
does it matter if the file is still saved as XLS? Does it have to be XLSX?
Would there be anything else that would prevent the code from running,
perhaps a security setting that I should check?
 
No XLS works fine, it just opens in compatibility mode.

As to security, it should prompt as before, but sometimes I have found it
doesn't, and there is a new bar with text and a button allowing you to
enable macros.

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
But did you check where the function resides, as Bob suggested? It should be in a Standard module, not a Sheet or Workbook module


--
Kind regards,

Niek Otten
Microsoft MVP - Excel

| does it matter if the file is still saved as XLS? Does it have to be XLSX?
| Would there be anything else that would prevent the code from running,
| perhaps a security setting that I should check?
|
|
| | > Works for me in XL2007 also
| > --
| > Bernard V Liengme
| > www.stfx.ca/people/bliengme
| > remove caps from email
| >
| > | >> Mark,
| >>
| >> It works fine for me. Are you stored in a standard code module?
| >>
| >> --
| >> ---
| >> HTH
| >>
| >> Bob
| >>
| >> (there's no email, no snail mail, but somewhere should be gmail in my
| >> addy)
| >>
| >>
| >>
| >> | >>> When I reference the below function in 2003 I get function displayed...
| >>> now in 2007 I get
| >>>
| >>> #NAME?
| >>>
| >>> Any idea what I need to change/set in 2007 so it will run this function?
| >>>
| >>> Function formulaText(x As Range)
| >>>
| >>> 'returns the text equivalent of formula in upper left cell in range x
| >>> 'example: =formulatext(a1) returns the formula found in cell a1 of
| >>> active worksheet
| >>> 'example: =formulatext(a1:b5) returns the formula found in cell a1 of
| >>> active worksheet
| >>> formulaText = x.Cells(1, 1).Formula
| >>>
| >>> End Function
| >>>
| >>> Thanks,
| >>> Mark
| >>>
| >>
| >>
| >
| >
|
|
 
Just guessing of course, but was the program listed in your Personal.xls
workbook?
Depending on what you are doing, you may have to reset your vba Library
reference to point to it.
Otherwise, the function name is something like:
=PERSONAL.XLS!FormulaText()
Again, just throwing out an idea..
 

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

Back
Top