Difference between range.formula and range.formulalocal

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

Hi,
If I'm writing a macro to check for the formula in a cell,
which proporty should I be using to be internationally
portable.
Say if I write the macro in English, I should be using
the formula proporty and not the FormulaLocal property
right?

Thanks
Andy
 
You have to write the macro in English in xl97 and later.

Use formula if you are going to pass it a string that would work in an
English Version of Excel. Use formulalocal if you will pass it a string
that will work in your regional version. This includes use of list
separators (comma versus period as an example).
 
I have a feeling that you might have misundertood what
I meant. What I want to accomplish is to override the
Application_BeforeDoubleClick(..) function to find out
what formula (if any) the double-clicked cell contains.
So

'
' the prototype for status routine is
' Function status(i as integer, j as integer) as integer
'
if InStr(activeCell.Formula, "=status(") = 1 Then
MsgBox("It's a Cell containing a call to the function status(i,j)");
Else
MsgBox("It's Not")
End If

In this example, I should be using the .Formula proporty and
not the .FormulaLocal proporty correct? Because .FormulaLocal
proporty would return something different depending on which
region Excel is. Correct? eg, in Europe .FormulaLocal would
return something like "=status(1;2)" and in the US, it would
return something like "=status(1,2)". So is it correct to say
that .Formula is more portable?

Andy
 
Back
Top