PDA

View Full Version : Solved: Strange Array Problem



pinky777
02-26-2005, 06:27 AM
Hi,
I recently switched to a Mac, and when trying to use my excel-macros from winxp, I got the following problem:

the code is something like:

Dim myArray()
myArray = Range("A1:D10").Value

and runs perfectly with win, but I get an error message "cannot assign values to data array" (or something like that, it's actually in German) with mac.

I tried to get some work-around, but nothing seems to work. I know that I could assign the values through a loop, but the idea was to avoid that (because the range, actually, is much much bigger, and assigning the values to the array directly is much faster!)

Anyone a clue?
Paul.

mdmackillop
02-26-2005, 08:54 AM
Try



Dim myArray
myArray = Range("A1:D10").Value

pinky777
02-26-2005, 09:09 AM
Thanks, it worked! (That was an easy one!)

Paleo
02-26-2005, 09:12 AM
Hi pinky777,

set the thread to Solved then.
At the top of this page select "Thread Tools" then "Mark Solved".

mdmackillop
02-26-2005, 09:14 AM
Glad to help. (I like the easy ones!)
MD