Hello,
I'm pretty new to macros and VBA and would be super grateful for some help with a pet project I've been working on over the past few weeks.
My project is a form where in the first worksheet the user selects various inputs from pre-defined (data validation) lists, which draws corresponding information from other "database" sheets (tables) and compiles it in an "output" sheet, which is basically the entire body of an e-mail, ready to copy and send. The recipient and CC addresses are stored in specific cells in a hidden sheet, and may change depending on the user's input in the first sheet. The from and BCC addresses should also be pre-set, but to a specific e-mail address which will not change depending on user input.
I'm at the point now where the entire form works as intended and generates the necessary output, ready to transfer to Outlook. I've created the command button, but I need help with the attached macro/VBA coding. I've found some simple tutorials for how to generate an e-mail from Outlook, but they all seem to include a fixed recipient, subject, body text etc., and I need those to be dynamic.
Here's the process I need automated:
1. Select cells B3 to B461 in the output sheet (this range will always be the same; empty rows are automatically hidden)
2. Copy the selection
3. Open Outlook and create a new e-mail
4. Set "From" (if possible) and "BCC" to a fixed e-mail address
5. Retrieve the recipient e-mail address from a specific cell in a hidden sheet
6. Retrieve the CC e-mail addresses from a specific cell in the hidden sheet (they are already stringed together in Outlook format, separated by semicolons)
7. Retrieve the e-mail subject from a specific cell in the hidden sheet
8. Paste the selection into the e-mail body
9. If possible, once pasted, convert the pasted selection from table to text using paragraph marks to separate text
I suppose this should be possible to do, and maybe it's not even that complicated, but it's currently too advanced for me to figure out on my own.
Any help would be greatly appreciated!
Bookmarks