title: Excel VBA attach multiple files from a cell which has file path
body: <p>I have code to create auto email based on the values in a table created in Excel. The code attaches only 1 file from cell value. If there are more than 1 files either in same cell or next column, I am sort of lost on how to achieve this being a novice in VBA field. Appreciate if anyone can help. </p>
  
  <p>Below is my code:-</p>
  
  <pre><code> Sub SendEmailWithAttachmentAndBody()
  
  'Created by Mirat for ****.
  'This code will autocreate emails along relevant attachents. User needs to create a master data file to include following fields in respective columns.
  'To = Column A.
  'CC = Column B.
  'Bcc = Column C.
  'Subject = Column D.
  'Body = Column E.
  'Attachment = Column F.
  'Only 1 file can be attached for now.
  
  Dim OlAPP As Outlook.Application
  Dim OlMail As Outlook.MailItem
  
  For i = 2 To Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
      Set OlAPP = New Outlook.Application
      Set OlMail = OlAPP.CreateItem(olMailItem)
  
      MailAttachment = Application.Cells(i, 6).Value
  
      With OlMail
      .Display
      End With
          Signature = OlMail.Body
  
      With OlMail
      .To = Cells(i, 1).Value
      .CC = Cells(i, 2).Value
      .BCC = Cells(i, 3)
      .Subject = Cells(i, 4).Value
      .HTMLBody = Cells(i, 5).Value &amp; "&lt;br&gt;" &amp; .HTMLBody
      .Attachments.Add MailAttachment
  
      .Display
  
      End With
  
      Set OlMail = Nothing
      Set OlAPP = Nothing
  Next
  
  
  End Sub
  </code></pre>