Advice to Improve Email List Macro

The Ruff Report

New Member
Joined
Jun 17, 2023
Messages
19
Office Version
  1. 365
Platform
  1. Windows
This macro works but I believe it can be improved, especially in the EmailSendTo with all the cell.Offsets (note I'm emailing up to 8 people per file but I didn't include all the code in the screen grab). Basically, the macro goes through each row and attaches/emails the file in column J to the recipients in columns B-J. Column A is just a typed user label and doesn't go anywhere. Also, the macro as written will stop if there isn't an address in column B. I'd like for it to still email the attachment if addresses are in say columns C and D but missing from B. Any help is greatly appreciated.


Picture2.png


Picture1.png
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi, you could try replacing the EmailSendTo = ... line with EmailSendTo = Application.TextJoin(";", True, cell.Resize(1, 8))

Just for future reference, it's much better (easier for your potential helpers) if you post your code directly into the thread (with code tags) instead of posting an image of your code.
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,021
Members
449,092
Latest member
ikke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top