title: Excel/VBA send email with hyperlink and variable cell value
body: <p>I have set up a standard module in workbook to send me an email. I am now stuck on two portions.</p>
  
  <ol>
  <li>I would like in the email to have the text "check list" by hyperlinked to http://"linktospreadsheet".html.</li>
  <li>The expiration date in the email text needs to be a variable value, dependent on a value within the linked spreadsheet.</li>
  </ol>
  
  <p>Also, can someone provide a guide on how to execute this module when the items expiration date is actually approaching? Below is the code:</p>
  
  <pre><code>Option Explicit
  
    Sub Mail_small_Text_Outlook()
      Dim OutApp As Object
      Dim OutMail As Object
      Dim strbody As String
  
      Set OutApp = CreateObject("Outlook.Application")
      Set OutMail = OutApp.CreateItem(0)
  
      strbody = "A plan is now # days from expiring" &amp; vbNewLine &amp; vbNewLine &amp; _
                "Please view the check list for details." &amp; vbNewLine &amp; vbNewLine &amp; _
                "http://linktospreadsheet.html"
      On Error Resume Next
      With OutMail
          .To = "name@email.com"
          .CC = ""
          .BCC = ""
          .Subject = "Subject"
          .Body = strbody
          .Attachments.Add ("C:\test.txt")
          .Send
      End With
      On Error GoTo 0
  
      Set OutMail = Nothing
      Set OutApp = Nothing
  End Sub
  </code></pre>