[VBA]HTML Email Body: How can I edit the format of added cell value?

ReventonKing

New Member
Joined
Oct 26, 2015
Messages
7
Hello Guys!

I have a code that creates an email. I need to address all the people by name, so I wrote this code:

Code:
strbodyhi = "< BODY style=font-size:11pt;font-family:Calibri >Hi & Sheets(29).Range(Cells(inter,22).Value" < /BODY >"

The result is this:
"Hi" & Sheets(29).Range(Cells(inter,22).Value"

Then I modified the code to this:
Code:
strbodyhi = "< BODY style=font-size:11pt;font-family:Calibri >Hi < /BODY >" & Sheets(29).Range("V" & inter).Value
The result of this is:
"Hi
Gréta"
So the added cell is not be in the same setup format, nor it is in the same row as "Hi"

Please help, thank you.
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Does this work for you?

Code:
strbodyhi = "< BODY style=font-size:11pt;font-family:Calibri >Hi " & Sheets(29).Cells(inter, 22).Value & "< /BODY >"

If not post what does work with a constant for the name.
 
Upvote 0

Forum statistics

Threads
1,226,693
Messages
6,192,471
Members
453,726
Latest member
JoeH57

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