Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Viveka Fischer   on Feb 21 In MS Office Category.

  
Question Answered By: Adaulfo Fischer   on Feb 21

Couple problems there. One of them is a little sneaky and not the source
of your error  but you should be aware of it. The declaration of your
variables will result in a and b being Typed as Variant and c as a string.

The source of the reported problem, though, is that you've no spaces
before or after the ampersand.

Sub MakeAString()

Dim a As String
Dim b As String
Dim c As String

a = "abc"
b = "def"
c = a & b & "another string"

Debug.Print c

End Sub

Share: 

 

This Question has 10 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on how to concatenate string variables Or get search suggestion and latest updates.


Tagged: