Pergunta

There is some way to type internationalized formulas on excel macros??

Right now im doing some like this:

If (languageCode = 1033) Then
  'type formula in english
  sheet.cell(r,c).Value = "=IF(A1=B1, "i18n", "#error")"
Else
  'type formula in another language
  sheet.cell(r,c).Value = "=SE(A1=B1, "i18n", "#erro")"
End If

Im using this logic because the client's excel is in a different language than mine, but the formula is realy big, and there are many other languages to cover.. so im not liking the way it going. :( I did some reseacrh but with no satisfactory answers.

This is my very first question so, sorry if I made some typo or format mistake.

Foi útil?

Solução

Accorcing to this article vba works internally with English, and Excel translates to the destination language at runtime. You should be able to do this with the formula property of the cell instead of the .value.

sheet.cell(r,c).Formula = "=IF(A1=B1, "i18n", "#error")"

See also Internationally Valid Excel Formula.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top