Forum Discussion
Diana703
Sep 07, 2022Copper Contributor
Need Help with Excel Macro
I have a large excel sheet (macro enabled) that I want to send email from with specific data in each email. I have all working right but I can't get it to create an email to send to each email addre...
- Sep 12, 2022
See the attached version. The code is in Module1.
HansVogelaar
Sep 07, 2022MVP
The code doesn't create any email messages since none of the rows satisfy the conditions in
If rngCell.Offset(0, 6) > 0 Then
ElseIf rngCell.Offset(0, 5) > Evaluate("Today() +7") And _
rngCell.Offset(0, 5).Value <= Evaluate("Today() +120") Then
Diana703
Sep 07, 2022Copper Contributor
The only thing I need it to do yet is to send out the emails to the individual recipients. It does create three emails but they are all going to the same person. Can you help me with this? Thank you.
- HansVogelaarSep 07, 2022MVP
I temporarily commented out the criteria, since they don't work, and don't make any sense to me. I got these three messages. Three different recipients, three different subjects, and (not shown) three different message texts. So the problem must lie elsewhere.
- Diana703Sep 12, 2022Copper ContributorCan you send me the code you used to get the above? I tried editing mine and it didn't work. Thank you.
- HansVogelaarSep 12, 2022MVP
See the attached version. The code is in Module1.
- Diana703Sep 07, 2022Copper ContributorThank you so much for continuing to help me. I'm not sure what you mean by " commented out the criteria"...what is the criteria? I'll take it out on my end if you tell me what it is and see if I get the same thing.
- HansVogelaarSep 07, 2022MVP
I meant the lines
If rngCell.Offset(0, 6) > 0 Then
ElseIf rngCell.Offset(0, 5) > Evaluate("Today() +7") And _
rngCell.Offset(0, 5).Value <= Evaluate("Today() +120") Thenand the corresponding End If.