Sub ExcelDepo()
son = Cells(Rows.Count, "I").End(xlUp).Row
ilk = 2
For i = 2 To son + Cells(son, "I").Value
'If Not i = son + Cells(son, "I").Value Then
If Not Cells(i, 3) = Cells(i + 1, 3) And Not "" = Cells(i + 1, 3) Then
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = Cells(ilk, 3).Value
.CC = ""
.BCC = ""
.Subject = "konu nedir"
.Body = "mesajınız"
' .HtmlBody = ""
sonx = i
For j = ilk To sonx
.Attachments.Add Cells(j, "h").Value
Next j
.display
' .Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
ilk = i + 1
End If
If i = son + Cells(son, "I").Value Then
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.To = Cells(ilk, 3).Value
.CC = ""
.BCC = ""
.Subject = "konu nedir"
.Body = "mesajınız"
' .HtmlBody = ""
'sonx = i
For j = 4 To 7
.Attachments.Add Cells(j, "h").Value
Next j
.display
' .Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End If
Next i
End Sub