Hi,
I dont know, if there is a solution to my problem
I have a long string ( a file path) which is contactentiated (via the ampersand) with some as strings (which should vary). This works perfect if i initialize the string in the vba code, but not at all when i try to initialize the long string via a Cell Range from the excel sheet
Below you find a simplified version of problem
Var2 does ignore the ampersand for contactenation, while Var does not. What can i do to make Var1 recognize the ampersand?
Thank you
I dont know, if there is a solution to my problem
I have a long string ( a file path) which is contactentiated (via the ampersand) with some as strings (which should vary). This works perfect if i initialize the string in the vba code, but not at all when i try to initialize the long string via a Cell Range from the excel sheet
Below you find a simplified version of problem
Var2 does ignore the ampersand for contactenation, while Var does not. What can i do to make Var1 recognize the ampersand?
Code:
Sub Stringcontact()
Dim var1 As String
Dim var2 As String
Dim datum_string As String
datum_string = "01/01/2010"
var1 = "Datum" & datum_string
var2 = Range("A1") 'Cell A1 is: Datum" & datum_string
MsgBox ("Var1: " & var1 & vbNewLine & "Var2: " & var2)
End Sub