title: Formatting email body from Excel contents
body: <p>I have a worksheet with given data,<br>
  <img src="https://i.stack.imgur.com/8wwxo.png" alt="enter image description here"></p>
  
  <p>I need to email the data using Microsoft Outlook in the required format for a specific date.</p>
  
  <p>Say the date is 05 Jan 2015.<br>
  <img src="https://i.stack.imgur.com/zkDaf.png" alt="enter image description here"></p>
  
  <p>This is how the email should look,<br>
  <img src="https://i.stack.imgur.com/ulnjW.png" alt="enter image description here"></p>
  
  <p>The code is written in the modules of the Excel 2007 workbook,</p>
  
  <pre><code>Public Function FormatEmail(Sourceworksheet As Worksheet, Recipients As Range, CoBDate As Date)
  
      Dim OutApp As Object
      Dim OutMail As Object
      Dim rows As Range
  
      On Error GoTo FormatEmail_Error
  
      Application.ScreenUpdating = False
      Set OutApp = CreateObject("Outlook.Application")
  
      For Each rows In Recipients.Cells.SpecialCells(xlCellTypeConstants)
  
          If rows.value Like "?*@?*.?*" Then
  
              Set OutMail = OutApp.CreateItem(0)
  
              On Error Resume Next
              With OutMail
                  .To = rows.value
                  .Subject = "Reminder"
                  .Body = "Hi All, " &amp; vbNewLine &amp; _
                           vbNewLine
                  .display
              End With
              On Error GoTo 0
  
              Set OutMail = Nothing
  
          End If
  
      Next rows
  
      On Error GoTo 0
      Exit Function
  
  FormatEmail_Error:
  
      Set OutApp = Nothing
      Application.ScreenUpdating = True
      MsgBox "Error " &amp; Err.Number &amp; " (" &amp; Err.Description &amp; ") in procedure FormatEmail of Module modOutlook"
  
  End Function
  </code></pre>