ı have exam records of 200 students. if there is an e-mail adress in column B,
columnA, columnC and columnD and E will be sent to related person. how can ı manage this by VBA?
A B C D E
1 SINEM [email protected] 1 66 78
2 marry [email protected] 1 89 4
that is 1st row will sent to [email protected]
2nd row will sent to [email protected]
etc.thanks for help
e-mail for every people only one row
-
-
-
Re: e-mail for every people only one row
Try the tips at this site http://www.rondebruin.nl/sendmail.htm
-
Re: e-mail for every people only one row
i saw all of those. but no answers to my question between them.
-
Re: e-mail for every people only one row
The code below is copied from the site and I think will do what you want.
Code
Display MoreSub TestFile() Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Dim cell As Range Application.ScreenUpdating = False Set OutApp = CreateObject("Outlook.Application") On Error GoTo cleanup For Each cell In Sheets("Sheet1").Columns("B").Cells.SpecialCells(xlCellTypeConstants) If cell.Offset(0, 1).Value <> "" Then If cell.Value Like "?*@?*.?*" And Dir(cell.Offset(0, 1).Value) <> "" Then Set OutMail = OutApp.CreateItem(olMailItem) With OutMail .To = cell.Value .Subject = "Testfile" .Body = "Hi " & cell.Offset(-1, 0).Value & cell.Offset(1, 0).Value & cell.Offset(2, 0).Value & cell.Offset(3, 0).Value .Display 'Or use Display End With Set OutMail = Nothing End If End If Next cell cleanup: Set OutApp = Nothing Application.ScreenUpdating = True End Sub
Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!