Kod:
Option Explicit
Sub Mail_Sheet_Outlook_Body()
' Don't forget to copy the function RangetoHTML in the module.
' Working in Office 2000-2007
Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Set rng = Nothing
Set rng = ActiveSheet.UsedRange
'You can also use a sheet name
'Set rng = Sheets("YourSheet").UsedRange
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.to = ""
.CC = "deneme@excel.web.tr"
.BCC = ""
.Subject = "Çağrı Değerlendirme" & " " & Date
.HTMLBody = RangetoHTML(rng)
.Display 'or use .Send
End With
On Error GoTo 0
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Yukarıdaki kod yardımıyla aktif sayfayı mail olarak gönderebiliyorum yalnız alıcı adresini el ile girmem gerekiyor. Buradaki To kısmını "Mail" isimli sayfada "A3" hücresinden çeksin istiyorum.
Birkaç değişiklik yaptım kodda denedim yalnız başaramadım.
Yardımlarınızı rica ederim arkadaşlar.
