Value from Cell to Autofill Email

Occasional Contributor
Hi,

I'm going to start by saying I'm a total noob on excel so apologies if this is a dumb question.

Basically I'm trying to make a tool where you fill in a form, click a button and the data from the table fills gaps in the body of the email.

For example: If you put your name is Lyle on the form, it'll start the email as "Hello Lyle," - if that makes sense.

I've got it all working apart from the email body itself. I'm trying to put the cells in but it's typing them out verbatim and I'm unsure how to continue.

Example:

emailItem.Body = "Hello," & vbNewLine & vbNewLine & "Please be advised quote number:" & "D4" & "has been accepted in our system"

The idea is to have whatever is in cell D4 going there but instead it's just putting the cell name (D4). Any help is very welcome, I'm trying to learn so if there's an easier way let me know!
2 Replies

@Elcten 

That would be

 

emailItem.Body = "Hello," & vbNewLine & vbNewLine & "Please be advised quote number: " & Range("D4").Value & " has been accepted in our system"

 

Note that I added spaces in the strings before and after the value of D4.

If the name Lyle (or whatever) is in E4, it could be

 

 

emailItem.Body = "Hello " & Range("E4").Value & "," & vbNewLine & vbNewLine & "Please be advised quote number: " & Range("D4").Value & " has been accepted in our system"

I'll give that a try! Thank you so much for your help