Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Local formula evaluate

Hello.

I will try to explain why I need to do this strange thing
and what's my problem.

For validation purposes, I need to add a second formula
to some cells, with this condition:
the second formula needs to track the position changes
of the cells she belongs to (and of the cells she points to)

The only way I have -in my humble knowledge- is using
the property formula1 from the validation object.

I use a custom validation engine and this let me choose
validation errors in a dedicated toolbar.

Unfortunately, this property (validation.formula1) needs to
be set in english, and returns a value in local language. (*)
For example:

With r.MergeArea.Validation
.Delete
.Add Type:=xlValidateCustom, Formula1:="=not(isblank(A1))"
End With

returns in the inmediate console:

?activesheet.cells(1,1).validation.formula1
=NO(ESBLANCO(A1))

When the validation engine needs to know if a cell is
validated, he needs to evaluate a local formula which
is not possible

?application.Evaluate("=NO(ESBLANCO(A1))")
Error 2029
?application.Evaluate("=NOT(ISBLANK(A1))")
Falso

Currently, I have to translate the local formula to english
with a method which is not as clean as it should be. (**)
This as been a shoddy work during some months but I'm not very
happy whit this portion of code.

So I would like to know if anyone can help me please:

1) I'm looking for a simple way to evaluate a local formula ¿any ideas?
2) If the first question is not so simple, I would
like to read the "validation.formula1" property not
as a local formula, but as an english one.
3) I would like also to set this "formula1" in local language.
¿Is it possible?

Thanks in advance.
Best regards, Luis.


(*)
This is true, as far as I know, in Excel 2000, 2002, and 2003

(**)
__________________________________________________ ___
Function Translate(str As String, Rng As Range) As String
'function to translate from local language to English
'Evaluate does not work with local formula
'where Rng is previously searched as the first empty cell
'who can be used as an aux cell
Rng.FormulaLocal = str
Translate = Rng.Formula
Rng.Formula = vbNullString
End Function
__________________________________________________ __



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
formula for local time and GMT? hsg Excel Worksheet Functions 1 January 9th 10 05:53 PM
Formula will not evaluate in VBA [email protected] Excel Programming 3 June 15th 07 11:07 PM
Might be a bug in Evaluate Formula? cyx Excel Discussion (Misc queries) 2 May 2nd 07 10:52 PM
Formula Will Not Evaluate Cecil Excel Worksheet Functions 3 April 25th 06 07:38 PM
Reference styles and local/non-local formulae - international problems. Alan Howells[_2_] Excel Programming 2 February 24th 04 09:52 AM


All times are GMT +1. The time now is 02:20 AM.

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"