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.
<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>
[TABLE="width: 85%"]
<tbody>[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
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.
A | B | C | D | E | F | G | H | I | |
---|---|---|---|---|---|---|---|---|---|
IN1000 | AU1000 | Hello | 123@gmail.com,456@gmail.com | 789@gmail.com | |||||
IN1000 | AU1000 | Hello Total | 123@gmail.com,456@gmail.com | 789@gmail.com | |||||
IN1000AU2000 | IN1000 | AU2000 | Hello | 123@gmail.com,456@gmail.com | 789@gmail.com | ||||
IN1000AU2000 | IN1000 | AU2000 | Hello Total | 123@gmail.com,456@gmail.com | 789@gmail.com | ||||
IN1000 | CH1000 | Hello | 123@gmail.com,456@gmail.com | 789@gmail.com | |||||
IN1000 | CH1000 | Hello Total | 123@gmail.com,456@gmail.com | 789@gmail.com | |||||
IN1000 | GB1000 | Hello | 123@gmail.com,456@gmail.com | 789@gmail.com | |||||
IN1000 | GB1000 | Hello | 123@gmail.com,456@gmail.com | 789@gmail.com | |||||
IN1000 | GB1000 | Hello Total | 123@gmail.com,456@gmail.com | 789@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: