View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Peter T[_5_] Peter T[_5_] is offline
external usenet poster
 
Posts: 84
Default alternate rowshading using conditional format excel 2007/2010

I'm pleased you discovered the problem! Your first macro worked fine for me,
and was the same as my own recorded macro. One more thing to keep in mind -
in English Excel (and most other languages) you'll need a comma, not a
semi-colon

Formula1:="=MOD(ROW(),2)=0" ' note the comma

If your code needs to cater for multiple languages use -

country = Application.International(xlCountryCode)

to translate the codes see
http://support.microsoft.com/kb/213833

I was convinced that writing VBA code in English could be run on any
machine with a different default language.


VB/A is mainly US English, however there are some Object model differences
with key words and many differences concerning Excel formulas (eg MOD v.
REST). Somewhere "out there" is a workbook with formula translations in
several languages. I don't have the link but it's probably not difficult to
find it

Regards,
Peter T


"Ludo" wrote in message
...

<SNIP


Hi all,

Found the problem!

I'm used to work on a English version of Excel at my work, but at home i use
a Dutch Office version, witch cause the problem.

When i change the formula to the Dutch equivalent of the English one, it's
working.
See below:
Sub Macro7()
Selection.FormatConditions.Add Type:=xlExpression,
Formula1:="=REST(RIJ();2)=0"
Selection.FormatConditions(Selection.FormatConditi ons.Count).SetFirstPriority
With Selection.FormatConditions(1).Interior
.PatternColorIndex = xlAutomatic
.Color = 255
.TintAndShade = 0
End With
Selection.FormatConditions(1).StopIfTrue = False
End Sub

But what i don't understand now is the fact that even i write the formula in
Dutch in the Conditional format form, that it isn't translated to English in
the VBA code. This means that when i want to use this VBA code on a English
machine that i have to change the formula in English to get it working.

I was convinced that writing VBA code in English could be run on any machine
with a different default language.

I can't follow anymore.
Weird behaviour, or i'm missing something crucial here.

&gt; Regards,
&gt; Ludo