ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   string concatenation (https://www.excelbanter.com/excel-programming/274388-string-concatenation.html)

Mike NG

string concatenation
 
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
--
Mike

Rob Bovey

string concatenation
 
"Mike NG" wrote in message
...
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 *



Dave Peterson[_3_]

string concatenation
 
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




Mike NG wrote:

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
--
Mike


--

Dave Peterson



All times are GMT +1. The time now is 07:18 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com