string concatenation

M

Mike NG

What's the difference between + and & for doing the job?

I thought from using an older version of excel, that + gave you a free
space, which was why I use &, but this no longer seems the case in
xl2000
 
R

Rob Bovey

Mike NG said:
What's the difference between + and & for doing the job?

I thought from using an older version of excel, that + gave you a free
space, which was why I use &, but this no longer seems the case in
xl2000

Hi Mike,

As far as I know, the ability to use + for string concatenation is
simply there for backward compatibility with early versions of BASIC.
There's no difference in their behavior that I'm aware of.

--
Rob Bovey, MCSE, MCSD, Excel MVP
Application Professionals
http://www.appspro.com/

* Please post all replies to this newsgroup *
* I delete all unsolicited e-mail responses *
 
D

Dave Peterson

I make enough mistakes. I don't think I want excel to guess what I really
wanted:

Option Explicit
Sub testme()

Dim myVal As Variant

myVal = 2 + 2: MsgBox myVal
myVal = 2 + "2": MsgBox myVal

myVal = 2 & 2: MsgBox myVal
myVal = 2 & "2": MsgBox myVal

End Sub
 

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