View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Array of formulas (regional difference)

I only use the USA version, so I couldn't test. But I don't think I'd rely on
the default property of the range (.value) to do the conversion correctly.

Maybe this would work ok:

Option Explicit
Sub testme01()
Dim x As Range
Dim y As Range
Dim w As Range

Set w = Range("A4")
Set x = Range("A5")
Set y = Range("A1:b1")

'test 1
x.Formula = "=if(a9=1,0,1)"
y.Formula = Array("hello", "=g1")

'test 2
y.Formula = Array("hello", "=if(a9=1,1,0)")

End Sub

(I had no idea what x and w represented in the formula. I didn't think that
they were the same as your range variables.)



ken4capitola wrote:

Following fragment works when the region is set for US, but fails for
Dutch

Dim x As Range
Dim y As Range
Dim w As Range
Set w = Range("AH4")
Set x = Range("AH5")
Set y = Range("AG1:AH1")

'Following works for both US and Dutch
x = "=if(x,0,0)"
y = Array("hello", "=w")

' Following works for US, but not in Dutch, why?
y = Array("hello", "=if(x,0,0)")


--

Dave Peterson