-
Sending Email in Excel VBA.
Hello,
My issue is using a variable containing a string of data (#1.) VS assigning a string to a variable (#2.).
1. I'm referencing cell "A2" which contains: "Hello Mike Jones," & vbNewLine "Have a nice day" & vbNewLine
My code in VBA :
Dim sMessage As String
sMessage = Range("A2")
Results: "Hello Mike Jones," & vbNewLine "Havew a nice day" & vbNewLine
2. Assigning a string to a variable.
Dim sMessage1 As String
sMessage1 = "Hello " & Name & "," & vbNewLine & vbNewLine & "Have a nice day" & vbNewLine
Results when doing debug.print sMessage1 :
Hello Mike Jones,
Have a nice day
Is there a way (function, method. etc...) that I can get the same results in step 1. as I have in step 2.
Thanks you,
Claude
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules