Forum Discussion
Diana703
Aug 25, 2022Copper Contributor
Excel Coding to send email
I have a spreadsheet that I want to send email from depending upon the date. I have it doing everything I want except it's not putting in who the email should go to. This is the code I have been us...
HansVogelaar
Aug 25, 2022MVP
The line
Set Rng = .Range("AK6", .Cells(.Rows.Count, 1).End(xlUp))
sets Rng to a range in columns A, B, C, ..., AK. For example, if the last filled cell in column A is A40, Rng is the range A6:AK40
You loop through ALL cells in that range. Is that really what you intended?
Diana703
Aug 26, 2022Copper Contributor
Right now I'm only using one line of data to set this sheet up to send email. I will actually have about a dozen different emails in there when I get it to working right. Right now, it creates the email and puts the message in, but it is not putting in the recipient's email in the TO line.