"Type mismatch" when I try to fill an Array variable with "+"

  • Thread starter Thread starter EagleOne
  • Start date Start date
E

EagleOne

2007/2007

I am having a brain fart.


Dim myArray(1 to 2) as long

myArray(1) = "+" does not work

When I attempt the step above, I get a type mismatch.

I thought that arrays were like a Variable.

myArray(1) = 25 works fine

I know that one can initialize an array like array("a", "b")

Why can I not store a string to myArray(1)???


TIA EagleOne
 
If each element in myArray is a long, then "+" won't work. (Longs are whole
numbers.)

Maybe

Dim myArray(1 to 2) as Variant 'or string???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top