Excel tips and tricks - Project Management: How to send an email automatically through Excel VBA


1

Editor's Pick

Here are the best stories on InsideIIM handpicked for you

Why MBA - Stories From Professionals Working At Google, Flipkart, Microsoft & More

Have you wondered why people choose to do an MBA? Perhaps for better work prospects and return on investment? Perhaps in order to gain an edge over others? Every year,

B-School Is Not A Placement Agency - Dr. Himanshu Rai, Director - IIM Indore, IIM Ahmedabad Alum

In this video, Dr. Himanshu Rai, Director at IIM Indore, Ex-Faculty at XLRI, IIM L, SDA Bocconi, Ex-Tata Steel, IIM A Alumni, talks to us about diversity and equality at

How A Non-Engineer Cracked CAT In Two Months And Made It To IIM Indore

Is it possible to crack an exam like CAT in a matter of just two months? Yes, and we bring to you an interview with someone who managed to not

How To Get Into Goldman Sachs For Investment Banking - A Fresher's Journey - Awiral Gupta, IIM I

Investment Banking, at some of India's top B-school campuses, is the most sought-after domains, owing to the steep learning curve and high packages offered by marquee firms. In this highly

'Don't Overhype CAT' - A CAT Topper Shares Tips To Score 99 Percentile In CAT 2019

The CAT exam is a tough nut to crack, and it takes a well-organised strategy and a bucket load of determination to crack the exam. So what kind of strategy

Argha De

Hi, great article on excel automation. However, there are couple of things in the code which I would like to highlight in order to make it more generic. 1) The code assumes that there are only 3 rows of data (A2:A5). If any other row is automatically added, then the code would need to be changed again, which can be trouble some for people who are not conversant with programming. 2) The email sender sub routine is dealing with outlook only. If the user uses any other email app (mozilla thunderbird etc.), then the code might throw errors. Again changes has to be made programmatically. Resolutions: 1) Code: Dim sh as worksheet Dim n as integer set sh = ActiveWorkbook.ActiveSheet n=2 while sh.Range("A" & n) "" 'Prog logic n = n+1 wend 2) Use workbook.sendmail function: this is a generic method and can be used with any email app. However, options like CC, BCC or setting the body of the mail can not be done. For that outlook has to be used. But this can be useful for someone who is not using outlook. Syntax: ActiveWorkbook.Sendmail abc@gmail.com "Mail subject" if the requirement is to send the mail to multiple recipients at one go, then the mail ids can be stored in an array and the array can be used in sendmail. Hope this helps

15 Jun, 2014 |


Argha De

A small correction: while sh.Range(“A” & n) ""

15 Jun, 2014 |


Argha De

For some reason not-equality sign ( less than symbol followed by greater than symbol) is not getting printed in the comments. The while loop should be: while sh.Range(“A” & n) not-equality symbol “”

15 Jun, 2014 |