So I have created the code below and bascally when I click a button an email will be sent to the selected row. However I want to make it so that it automatically goes to the next row and sends an email to that user. I tried a loop code but that only sent the email to the first email account numerous times (it was a little ridiculous to be honest). Any help with how to code this would be greatly appreciated.
Code:
Private Sub Command18_Click()
Dim OutApp As Object
Dim OutMail As Object
Dim strto As String, strcc As String, strbcc As String
Dim strsub As String, strBody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strto = [email]
strcc = ""
strbcc = ""
strsub = "test"
strBody = "test"
With OutMail
.To = strto
.CC = strcc
.BCC = strbcc
.Subject = strsub
.Body = strBody
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub