Private Sub CommandButton1_Click()
"To be able to send correctly and need to configure Microsoft Outlook effectively
On Error Resume Next
Dim rowCount, endRowNo
Dim objOutlook As New Outlook.Application
Dim objMail As MailItem
Dim SigString As String
Dim Signature As String
'Get the number of rows In the data area to which the current worksheet is connected to cells (1,1)
endRowNo = Application.WorksheetFunction.CountIfs(Range(“A:A”), “<>”)
'Create objOutlook as Outlook application object
Set objOutlook = New Outlook.Application
'Start sending emails in a loop, like starting from the second line, the first line is the address
For rowCount = 2 To endRowNo
Set objMail = objOutlook.CreateItem (olMailItem) 'Create objMail as mail object
' Extract mail signature
SigString = Worksheets(“Sheet1”).Cells(2, 5)
If Dir(SigString) <> “” Then
Signature = GetBoiler(SigString)
Else
Signature = “”
End If
With objMail
.To = Cells (rowCount, 1) .Value Set the recipient’s address (obtained from the “Email Address” field in the first column of the Excel sheet).
CC = Cells (rowCount, 2). Value set the CC address (obtained from the Mail Address field in the second column o
Need VBA Code to send email based on unique email id.
Sayeed Ahmed M
1
Reputation point
Hi team,
I need vba code to send email based on unique email id. Column L - will contain multiple email ids, therefore, based on unique email id from column L, data should be filtered and snapshot of Range A to K should be displayed on email body. it should pick .to from column L.
Multiple emails should be generated based on this code.
Please help.
Developer technologies Visual Basic for Applications
1,508 questions
2 answers
Sort by: Most helpful
-
Wafa Ibrahim Ali Asakrah 66 Reputation points
2022-06-22T20:46:30.783+00:00 -
Wadha Mohammad Al Haribat 81 Reputation points
2022-06-23T11:46:06.78+00:00 Through the email available on the Thames or Outlook