Need Help with Excel / VBA HTML Email

I'm working in Excel to create an automated email list, but now have to also include disclosure information at the bottom of the email. I wrote a quick macro in excel to pull in the latest disclosure information into a separate worksheet in this workbook. However, I need help with the email macro to include the disclosure text and nicely format the text. I have flagged in the sample workbook where this text needs to be placed.
Client-Emails-Sample.xlsm
Craig JohnsonChief Technical Market StrategistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bill PrewCommented:
Try this code in your VBA macro, it will pull in the Disclosures information.  Adjust the formatting as needed, not sure exactly what you are looking for...

                 '--------------------------
                 'This is where the disclosures need to go from the disclosure tab and nicely formatted
                 Dim i As Long
                 txt = txt & "<div style=""FONT-SIZE: 8pt; FONT-FAMILY: &quot;Arial&quot;,&quot;sans-serif&quot;; COLOR: blue"">"
                 With Sheets("Disclosures")
                    For i = 1 To .Cells(Rows.Count, 1).End(xlUp).Row
                        txt = txt & .Cells(i, 1) & "<br>"
                    Next
                 End With
                 txt = txt & "</div>"
                 '--------------------------

Open in new window


»bp
1

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Fabrice LambertFabrice LambertCommented:
Best way to do this, is to grab an WYSIWYG HTML editor, then either:
- Copy / paste the source code of your disclosure from the editor to VBA (In other words: Hard-code it).
- Copy / paste the source code of your disclosure from the editor to a cell in a sheet you'll hide.
Your VBA will just have to pull the disclosure from the hidden sheet (easyer to maintain).
1
NorieData ProcessorCommented:
Craig

How would you want the disclosure text formatted?
0
Craig JohnsonChief Technical Market StrategistAuthor Commented:
Great answer and it works perfect!
1
Bill PrewCommented:
Great, glad that was helpful.


»bp
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
HTML

From novice to tech pro — start learning today.