VBA send email from excel (depending on condition)
<p>I am an absolute beginner and try to facilitate a few tasks in my colleagues daily work. I want to create a code that sends reminder mails with information from an excel file. The idea is that Excel should check every relevant row from row 12 on and check if there is an "x" written in a column that marks for which row I would like to send a reminder.
With the code below I can generate all the emails, but I have difficulties where and how to include the check for if ('If Cells(s, 6).Value = "x" Then') so that that Excel continues through all the rows that are filled out.</p>

<p>Many thanks for your help!</p>

<pre> <code>
Sub SendReminderMail() 
  Dim s As Long
  Dim OutLookApp As Object
  Dim OutLookMailItem As Object
  Dim iCounter As Integer
  Dim MailDest As String

  If MsgBox("Are you sure?", vbYesNo) = vbNo Then Exit Sub

  Set OutLookApp = CreateObject("Outlook.application")
  Set OutLookMailItem = OutLookApp.CreateItem(0)

  s = 12

  Do Until Trim$(Cells(s, 1).Value) = ""

    Set OutLookMailItem = OutLookApp.CreateItem(0)
    With OutLookMailItem
      .To = Cells(s, 5).Value
      .Subject = "Reminder: " & Cells(1, 7).Value
      .Body = "Text, " & vbCrLf & vbCrLf & "Text'" & Cells(s, 2).Value 
      s = s + 1
      .Display
    End With
  Loop
End Sub
</code></pre>