title: Send email with information from active line
body: <p>I am trying to build a macro in Excel to send email with content from an active line (for example, clicking on a line, selecting all its content).</p>
  <p>I need to take the email address from a cell on that line and assign it to the email To field.<br />
  The Subject field should have a title and adding at its end data from a cell on selected line.<br />
  In the body, I need to include content from selected line.<br />
  Before every selected cells' content, I need to enter a title.</p>
  <p>Can I directly send an email through Excel, or is it possible to send the email by opening Outlook and having all the data ready using the macro?</p>
  <p>Here's what is displayed in a spreadsheet:</p>
  <pre><code>FirstName LastName PhoneNumber
  Dan       Daniels  123
  Jim       Jameson  321
  </code></pre>
  <p>If the second line is the selected line, the email should look like this:</p>
  <pre><code>To: email@email.com
  Subject: Random text - Dan Daniels
  Body:
  
  Hello,
  
  FirstName: Dan
  LastName: Daniels
  PhoneNumber: 123
  </code></pre>
  <p>Here is the code I modified and gives me compiling error:</p>
  <pre><code>Sub SendMail()
      Dim OutlookApp As Object: Set OutlookApp = CreateObject(&quot;Outlook.Application&quot;)
      Dim var As Variant: var = Selection.Value
      Set MyMail = OutlookApp.CreateItem(0)
      With MyMail
          .To = var(1, 35)
          .Subject = &quot;Email for Random Text Text Text Here -&quot; &amp; &quot; &quot; &amp; var(1, 17) &amp; &quot; &quot; &amp; var(1, 18)
          .body = &quot;This is an email informing you that random text aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&quot; &amp; vbNewLine &amp; vbNewLine &amp; &quot;Created by: &quot; &amp; var(1, 4) &amp; vbNewLine &amp; &quot;Date Information Posted: &quot; &amp; var(1, 6) &amp; vbNewLine &amp; &quot;Random Data One Showing: &quot; &amp; var(1, 28) &amp; vbNewLine &amp; &quot;Another Random Data: &quot; &amp; var(1, 29) &amp; vbNewLine &amp; &quot;Requester Random First Name: &quot; &amp; var(1, 13) &amp; vbNewLine &amp; &quot;Requester Random Last Name: &quot; &amp; var(1, 14) &amp; vbNewLine &amp; &quot;Requester Random Here E-mail: &quot; &amp; var(1, 15) &amp; vbNewLine &amp; &quot;Requester Random Phone Number: &quot; &amp; var(1, 16) &amp; vbNewLine &amp; &quot;Person's Random First Name: &quot; &amp; var(1, 17) &amp; vbNewLine &amp; &quot;Person's Random Last Name: &quot; &amp; var(1, 18) &amp; vbNewLine &amp; &quot;Person's Random Location: &quot; &amp; var(1, 21)  &amp; vbNewLine &amp; &quot;Person's Random Occupation: &quot; &amp; var(1, 22) &amp; vbNewLine &amp; &quot;Person's Random Hometown: &quot; &amp; var(1, 23) &amp; vbNewLine &amp; &quot;Where he is located: &quot; &amp; var(1, 24) &amp; vbNewLine &amp; &quot;PErson's Email Address: &quot; &amp; var(1, 19) &amp; vbNewLine &amp; &quot;Number of items requested: &quot; &amp; var(1, 8) &amp; vbNewLine &amp; &quot;Requested Items Number: &quot; &amp; var(1, 31) &amp; vbNewLine &amp; &quot;Name of Item: &quot; &amp; var(1, 22) &amp; vbNewLine &amp; vbNewLine &amp; &quot;This is a random text I need to add at the end of the mail, text being quite looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooog random text random text random text random text random text random text&quot;
      End With
      MyMail.send
  End Sub
  </code></pre>
  <p>The data from columns are simple characters, names, numbers or email addresses. I have 35 columns, but need just the above ones.</p>