DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Sub kod()
Dim S1 As Worksheet: Set S1 = Sheets("Sayfa1")
Dim S2 As Worksheet: Set S2 = Sheets("Sayfa2")
For a = 2 To S1.Cells(Rows.Count, "A").End(3).Row
S2.Range("A2") = S1.Cells(a, "A")
yol1 = CreateObject("WScript.Shell").specialfolders("Desktop")
yol2 = Replace(yol1, "Desktop", "Documents") & "\" & S2.Range("A2") & "_" & Format(Now, "ddmmyyhhmmss") & ".pdf"
S2.ExportAsFixedFormat Type:=xlTypePDF, Filename:=yol2
Dim xlOutlook As Object
Dim xlMail As Object
Set xlOutlook = CreateObject("Outlook.Application")
Set xlMail = xlOutlook.CreateItem(0)
With xlMail
.to = S1.Cells(a, "B").Value
.CC = S1.Cells(a, "C").Value
.Subject = "Konu"
.Attachments.Add yol2
.Importance = 2
.Save
.Send
End With
Set xlMail = Nothing
Set xlOutlook = Nothing
Kill yol2
Next a
End Sub
Sub kod()
Dim S1 As Worksheet: Set S1 = Sheets("Sayfa1")
Dim S2 As Worksheet: Set S2 = Sheets("Sayfa2")
sor = MsgBox("Mail Göndermek İstediğinize Emin Misiniz?", vbYesNo)
If sor = vbNo Then Exit Sub
For a = 2 To S1.Cells(Rows.Count, "A").End(3).Row
S2.Range("A2") = S1.Cells(a, "A")
yol1 = CreateObject("WScript.Shell").specialfolders("Desktop")
yol2 = Replace(yol1, "Desktop", "Documents") & "\" & S2.Range("A2") & "_" & Format(Now, "ddmmyyhhmmss") & ".pdf"
S2.ExportAsFixedFormat Type:=xlTypePDF, Filename:=yol2
Dim xlOutlook As Object
Dim xlMail As Object
Set xlOutlook = CreateObject("Outlook.Application")
Set xlMail = xlOutlook.CreateItem(0)
With xlMail
.to = S1.Cells(a, "B").Value
.CC = S1.Cells(a, "C").Value
.Subject = "Konu"
.Attachments.Add yol2
.Importance = 2
.Save
.Send
End With
Set xlMail = Nothing
Set xlOutlook = Nothing
Kill yol2
Next a
End Sub
Sub kod()
Dim S1 As Worksheet: Set S1 = Sheets("Sayfa1")
Dim S2 As Worksheet: Set S2 = Sheets("Sayfa2")
For a = 2 To S1.Cells(Rows.Count, "A").End(3).Row
S2.Range("A2") = S1.Cells(a, "A")
sor = MsgBox(S2.Range("A2") & Chr(10) & "Mail Göndermek İstediğinize Emin Misiniz?", vbYesNo, "")
If sor = vbNo Then
Else
yol1 = CreateObject("WScript.Shell").specialfolders("Desktop")
yol2 = Replace(yol1, "Desktop", "Documents") & "\" & S2.Range("A2") & "_" & Format(Now, "ddmmyyhhmmss") & ".pdf"
S2.ExportAsFixedFormat Type:=xlTypePDF, Filename:=yol2
Dim xlOutlook As Object
Dim xlMail As Object
Set xlOutlook = CreateObject("Outlook.Application")
Set xlMail = xlOutlook.CreateItem(0)
With xlMail
.to = S1.Cells(a, "B").Value
.CC = S1.Cells(a, "C").Value
.Subject = "Konu"
.Attachments.Add yol2
.Importance = 2
.Save
.Send
End With
Set xlMail = Nothing
Set xlOutlook = Nothing
Kill yol2
End If
Next a
End Sub
.Body = "Merhaba," & Chr(10) & "Ekli Çalışmanız bu şekildedir." & Chr(10) & "Syg."