View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_3_] Dave Peterson[_3_] is offline
external usenet poster
 
Posts: 2,824
Default 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