Here is your new code:
Sub SendEMail()
Dim Email As String, Subj As String
Dim Msg As String, URL As String
Dim r As Long, s as Long x As Double
s = ActiveSheet.UsedRange.Rows.Count
For r = 2 To s
' Get the email address
Email = Cells(r, 2)
' Message subject
Subj = "Deal Registration Expiring" & " " & Cells(r, 4) & " " & "for" & " " & Cells(r, 6)
' Compose the message
Msg = ""
Msg = Msg & "Dear " & Cells(r, 1) & "," & vbCrLf & vbCrLf
Msg = Msg & "Your deal registration for " & Cells(r, 3) & " " & Cells(r, 4) & " " & Cells(r, 5) & " " & Cells(r, 6) & " " & "is about to expire. Please respond with a brief update and new expected closure if this deal is still live - otherwise this deal will be closed and marked as lost."
Msg = Msg & " " & vbCrLf
Msg = Msg & "My Name" & vbCrLf
Msg = Msg & "Registration Manager"
' Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")
' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
' Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg
' Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
' Wait two seconds before sending keystrokes
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%s"
Next r
End Sub
Bookmarks