Writing code according to a model.

D

Dave Neve

Hi

The following line is taken from the help pages of VBA.

Join(sourcearray[, delimiter])

But in spite of it's simplicity, VBA will not accept my code (this happens a
lot to me)

Join(A[, " "])

A is my Array and the two " " have a space between them as delimiter.

What is wrong with such a simple line of code?

Thanks
 
A

Alex Ivanov

Dave,

Remove brackets[] and it should work.
In Help brackets ususlly mean that whatever is within is optional, in your
case
Join(A, " ") and Join(A) will produce the same result.

Alex.
 
P

Peter Hewett

Hi Dave Neve

When you see VBA code examples or documentation that uses "[]" square brackets
in this way it denotes an optional argument.

HTH + Cheers - Peter


Dave,

Remove brackets[] and it should work.
In Help brackets ususlly mean that whatever is within is optional, in your
case
Join(A, " ") and Join(A) will produce the same result.

Alex.

Dave Neve said:
Hi

The following line is taken from the help pages of VBA.

Join(sourcearray[, delimiter])

But in spite of it's simplicity, VBA will not accept my code (this happens a
lot to me)

Join(A[, " "])

A is my Array and the two " " have a space between them as delimiter.

What is wrong with such a simple line of code?

Thanks
 

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

Top