exceluser9
Active Member
- Joined
- Jun 27, 2015
- Messages
- 388
Hi Team,
I have a data as below and the data starts from row 3. Row 1 and 2 are headers.
What i want macro to do is to create a new workbook for respective user and draft an email with standard text from outlook. In below example for James there should be 2 emails generated because the name is same and the email address is different.
Also if the generic mail id is different then it has to create a new workbook for this generic id.
So the logic will be based on Generic mailid, User and User email and these headers are in row 2
Generic mailid - column E
User - column - H
User email address column P
Data will be until row AZ
Text is - Please go through attached file.
Workbook should be created from row 1 till the end of the data.
[TABLE="width: 1870"]
<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]ID[/TD]
[TD]From[/TD]
[TD]Date[/TD]
[TD]Country[/TD]
[TD]Generic mailid[/TD]
[TD]Contracter name[/TD]
[TD]Activity[/TD]
[TD]User[/TD]
[TD]Reporter[/TD]
[TD]Form[/TD]
[TD]TAT[/TD]
[TD]Days[/TD]
[TD]Form[/TD]
[TD]TAT[/TD]
[TD]Days[/TD]
[TD]User email[/TD]
[/TR]
[TR]
[TD]8675[/TD]
[TD]John[/TD]
[TD]05/03/2019[/TD]
[TD]ENG[/TD]
[TD]Roy@gmail.com[/TD]
[TD]Muller[/TD]
[TD]Setup[/TD]
[TD]Wright[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Wight@gmail.com[/TD]
[/TR]
[TR]
[TD]78678[/TD]
[TD]Kevin[/TD]
[TD]13/03/2019[/TD]
[TD]AST[/TD]
[TD]Roy@gmail.com[/TD]
[TD]Danone[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]James@gmail.com[/TD]
[/TR]
[TR]
[TD]8679[/TD]
[TD]Johny[/TD]
[TD]05/04/2019[/TD]
[TD]RS[/TD]
[TD]Roy@gmail.com[/TD]
[TD]Nestle[/TD]
[TD]Setup[/TD]
[TD]Vince[/TD]
[TD]Roy[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Vince@gmail.com[/TD]
[/TR]
[TR]
[TD]78673[/TD]
[TD]Kevin Peter[/TD]
[TD]13/02/2019[/TD]
[TD]IT[/TD]
[TD]Roy@gmail.com[/TD]
[TD]Choco[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]James@gmail.com[/TD]
[/TR]
[TR]
[TD]8787[/TD]
[TD]Paul[/TD]
[TD]13/03/2019[/TD]
[TD]IT[/TD]
[TD]Roy@gmail.com[/TD]
[TD]Dominos[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Jaison[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Jamesorg@gmail.com[/TD]
[/TR]
[TR]
[TD]86752[/TD]
[TD]John[/TD]
[TD]05/03/2019[/TD]
[TD]ENG[/TD]
[TD]Roy@ymail.com[/TD]
[TD]Muller[/TD]
[TD]Setup[/TD]
[TD]Wright[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Wight@gmail.com[/TD]
[/TR]
[TR]
[TD]786784[/TD]
[TD]Kevin[/TD]
[TD]13/03/2019[/TD]
[TD]AST[/TD]
[TD]Roy@ymail.com[/TD]
[TD]Danone[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]James@gmail.com[/TD]
[/TR]
[TR]
[TD]86796[/TD]
[TD]Johny[/TD]
[TD]05/04/2019[/TD]
[TD]RS[/TD]
[TD]Roy@ymail.com[/TD]
[TD]Nestle[/TD]
[TD]Setup[/TD]
[TD]Vince[/TD]
[TD]Roy[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Vince@gmail.com[/TD]
[/TR]
[TR]
[TD]786739[/TD]
[TD]Kevin Peter[/TD]
[TD]13/02/2019[/TD]
[TD]IT[/TD]
[TD]Roy@ymail.com[/TD]
[TD]Choco[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]James@gmail.com[/TD]
[/TR]
[TR]
[TD]87875[/TD]
[TD]Paul[/TD]
[TD]13/03/2019[/TD]
[TD]IT[/TD]
[TD]Roy@ymail.com[/TD]
[TD]Dominos[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Jaison[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Jamesorg@gmail.com[/TD]
[/TR]
</tbody>[/TABLE]
Thanks
I have a data as below and the data starts from row 3. Row 1 and 2 are headers.
What i want macro to do is to create a new workbook for respective user and draft an email with standard text from outlook. In below example for James there should be 2 emails generated because the name is same and the email address is different.
Also if the generic mail id is different then it has to create a new workbook for this generic id.
So the logic will be based on Generic mailid, User and User email and these headers are in row 2
Generic mailid - column E
User - column - H
User email address column P
Data will be until row AZ
Text is - Please go through attached file.
Workbook should be created from row 1 till the end of the data.
[TABLE="width: 1870"]
<colgroup><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]ID[/TD]
[TD]From[/TD]
[TD]Date[/TD]
[TD]Country[/TD]
[TD]Generic mailid[/TD]
[TD]Contracter name[/TD]
[TD]Activity[/TD]
[TD]User[/TD]
[TD]Reporter[/TD]
[TD]Form[/TD]
[TD]TAT[/TD]
[TD]Days[/TD]
[TD]Form[/TD]
[TD]TAT[/TD]
[TD]Days[/TD]
[TD]User email[/TD]
[/TR]
[TR]
[TD]8675[/TD]
[TD]John[/TD]
[TD]05/03/2019[/TD]
[TD]ENG[/TD]
[TD]Roy@gmail.com[/TD]
[TD]Muller[/TD]
[TD]Setup[/TD]
[TD]Wright[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Wight@gmail.com[/TD]
[/TR]
[TR]
[TD]78678[/TD]
[TD]Kevin[/TD]
[TD]13/03/2019[/TD]
[TD]AST[/TD]
[TD]Roy@gmail.com[/TD]
[TD]Danone[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]James@gmail.com[/TD]
[/TR]
[TR]
[TD]8679[/TD]
[TD]Johny[/TD]
[TD]05/04/2019[/TD]
[TD]RS[/TD]
[TD]Roy@gmail.com[/TD]
[TD]Nestle[/TD]
[TD]Setup[/TD]
[TD]Vince[/TD]
[TD]Roy[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Vince@gmail.com[/TD]
[/TR]
[TR]
[TD]78673[/TD]
[TD]Kevin Peter[/TD]
[TD]13/02/2019[/TD]
[TD]IT[/TD]
[TD]Roy@gmail.com[/TD]
[TD]Choco[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]James@gmail.com[/TD]
[/TR]
[TR]
[TD]8787[/TD]
[TD]Paul[/TD]
[TD]13/03/2019[/TD]
[TD]IT[/TD]
[TD]Roy@gmail.com[/TD]
[TD]Dominos[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Jaison[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Jamesorg@gmail.com[/TD]
[/TR]
[TR]
[TD]86752[/TD]
[TD]John[/TD]
[TD]05/03/2019[/TD]
[TD]ENG[/TD]
[TD]Roy@ymail.com[/TD]
[TD]Muller[/TD]
[TD]Setup[/TD]
[TD]Wright[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Wight@gmail.com[/TD]
[/TR]
[TR]
[TD]786784[/TD]
[TD]Kevin[/TD]
[TD]13/03/2019[/TD]
[TD]AST[/TD]
[TD]Roy@ymail.com[/TD]
[TD]Danone[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]James@gmail.com[/TD]
[/TR]
[TR]
[TD]86796[/TD]
[TD]Johny[/TD]
[TD]05/04/2019[/TD]
[TD]RS[/TD]
[TD]Roy@ymail.com[/TD]
[TD]Nestle[/TD]
[TD]Setup[/TD]
[TD]Vince[/TD]
[TD]Roy[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Vince@gmail.com[/TD]
[/TR]
[TR]
[TD]786739[/TD]
[TD]Kevin Peter[/TD]
[TD]13/02/2019[/TD]
[TD]IT[/TD]
[TD]Roy@ymail.com[/TD]
[TD]Choco[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Ronak[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]James@gmail.com[/TD]
[/TR]
[TR]
[TD]87875[/TD]
[TD]Paul[/TD]
[TD]13/03/2019[/TD]
[TD]IT[/TD]
[TD]Roy@ymail.com[/TD]
[TD]Dominos[/TD]
[TD]Setup[/TD]
[TD]James[/TD]
[TD]Jaison[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD]Jamesorg@gmail.com[/TD]
[/TR]
</tbody>[/TABLE]
Thanks