title: Custom Subject line for Outlook
body: <p>I'm working on automating an Excel database so by clicking a button, the macro will automatically send an email using the email, subject, and body for that specific row entry.</p>
  
  <p><a href="https://i.stack.imgur.com/Av5z1.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Av5z1.jpg" alt="enter image description here"></a></p>
  
  <p>For example, I want to press the button and the macro automatically sends out emails to the cells filled in Red to their respective emails with the customized subject.</p>
  
  <p>I found some code online that, once pressed, will send out an automatic email. However, the subject line isn't customized.</p>
  
  <p>Here's the code I'm working on right now:</p>
  
  <pre><code>Sub SendReminderMail()
  Dim OutLookApp As Object
  Dim OutLookMailItem As Object
  Dim iCounter As Integer
  Dim MailDest As String
  Dim SUBJECT As String
  
  Set OutLookApp = CreateObject("Outlook.application")
  Set OutLookMailItem = OutLookApp.CreateItem(0)
  
  With OutLookMailItem
  .SUBJECT = ""
  For iCounter = 1 To WorksheetFunction.CountA(Columns(4))
  If SUBJECT = "" And Cells(iCounter, 4).Offset(0, -1) = "Send Reminder" Then
  .SUBJECT = Cells(iCounter, 6).Value
  ElseIf SUBJECT &lt;&gt; "" And Cells(iCounter, 4).Offset(0, -1) = "Send Reminder" Then
  SUBJECT = SUBJECT &amp; ";" &amp; Cells(iCounter, 6).Value
  
  End If
  Next iCounter
  
  MailDest = ""
  For iCounter = 1 To WorksheetFunction.CountA(Columns(4))
  If MailDest = "" And Cells(iCounter, 4).Offset(0, -1) = "Send Reminder" Then
  MailDest = Cells(iCounter, 4).Value
  ElseIf MailDest &lt;&gt; "" And Cells(iCounter, 4).Offset(0, -1) = "Send Reminder" Then
  MailDest = MailDest &amp; ";" &amp; Cells(iCounter, 4).Value
  End If
  
  Next iCounter
  
  
  .BCC = MailDest
  .Body = "Reminder: Time to contact this firm"
  .Send
  
  End With
  
  Set OutLookMailItem = Nothing
  Set OutLookApp = Nothing
  
  
  
  End Sub
  </code></pre>
  
  <p>Current problems I'm facing:</p>
  
  <ol>
  <li><p>The email sends out to the correct email addresses but the subject is ALWAYS the subject in the 6th row - "Reminder to email Andrew". It doesn't change for other contacts. I need the subject to change for every email to each different contact.</p></li>
  <li><p>I noticed if I have different contact names but they're listed under the same e-mail address, then the macro will only e-mail to the first entry with the same e-mail, but not the second one.</p></li>
  </ol>
  
  <p>Any help is appreciated. Thanks</p>