VBA email from outlook - Excel pivot

Miratshah

Board Regular
Joined
Nov 29, 2016
Messages
57
Hi,

I went through http://www.rondebruin.nl/sendmail.htm however it did not help since I am not much familiar with writing VBA code.

Can anyone help me with VBA to send email based on values in Excel pivot? I have embedded a sample excel file below:-

I need separate email where column A value changes which should have body of email from column B to G. Emails in To and CC can be picked up from column H and I respectively. Rest of the body like "Hi, please find below details" can be static for all emails.

ABCDEFGHI
IN1000AU1000Hello123@gmail.com,456@gmail.com789@gmail.com
IN1000AU1000Hello Total123@gmail.com,456@gmail.com789@gmail.com
IN1000AU2000IN1000AU2000Hello123@gmail.com,456@gmail.com789@gmail.com
IN1000AU2000IN1000AU2000Hello Total123@gmail.com,456@gmail.com789@gmail.com
IN1000CH1000Hello123@gmail.com,456@gmail.com789@gmail.com
IN1000CH1000Hello Total123@gmail.com,456@gmail.com789@gmail.com
IN1000GB1000Hello123@gmail.com,456@gmail.com789@gmail.com
IN1000GB1000Hello123@gmail.com,456@gmail.com789@gmail.com
IN1000GB1000Hello Total123@gmail.com,456@gmail.com789@gmail.com

<tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #DDEBF7"]Join[/TD]
[TD="bgcolor: #DDEBF7"]Party[/TD]
[TD="bgcolor: #DDEBF7"]AffiliateParty[/TD]
[TD="bgcolor: #DDEBF7"]Code[/TD]
[TD="bgcolor: #DDEBF7"]Invoice Date[/TD]
[TD="bgcolor: #DDEBF7"]Invoice No.[/TD]
[TD="bgcolor: #DDEBF7"]Total[/TD]
[TD="bgcolor: #DDEBF7"]To[/TD]
[TD="bgcolor: #DDEBF7"]CC[/TD]

[TD="align: center"]2[/TD]
[TD="bgcolor: #FFFF00"]IN1000AU1000[/TD]

[TD="align: right"]09/01/2019[/TD]
[TD="align: right"]856166785[/TD]
[TD="align: right"] -2,10,696[/TD]

[TD="align: center"]3[/TD]
[TD="bgcolor: #FFFF00"]IN1000AU1000[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"] -2,10,696[/TD]

[TD="align: center"]4[/TD]

[TD="align: right"]09/01/2019[/TD]
[TD="align: right"]856166786[/TD]
[TD="align: right"] -7,37,437[/TD]

[TD="align: center"]5[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"] -7,37,437[/TD]

[TD="align: center"]6[/TD]
[TD="bgcolor: #00B0F0"]IN1000CH1000[/TD]

[TD="align: right"]18/01/2019[/TD]
[TD="align: right"]856166913[/TD]
[TD="align: right"] -1,07,928[/TD]

[TD="align: center"]7[/TD]
[TD="bgcolor: #00B0F0"]IN1000CH1000[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"] -1,07,928[/TD]

[TD="align: center"]8[/TD]
[TD="bgcolor: #FFD966"]IN1000GB1000[/TD]

[TD="align: right"]22/01/2019[/TD]
[TD="align: right"]856166937[/TD]
[TD="align: right"] -4,32,250[/TD]

[TD="align: center"]9[/TD]
[TD="bgcolor: #FFD966"]IN1000GB1000[/TD]

[TD="align: right"]19/02/2019[/TD]
[TD="align: right"]856167320[/TD]
[TD="align: right"] -1,64,273[/TD]

[TD="align: center"]10[/TD]
[TD="bgcolor: #FFD966"]IN1000GB1000[/TD]

[TD="align: right"][/TD]
[TD="align: right"][/TD]
[TD="align: right"] -5,96,522[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 
Last edited:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

Forum statistics

Threads
1,223,702
Messages
6,173,961
Members
452,539
Latest member
delvey

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top