Hi everyone, Happy New Year!
I've got the following code below however I can't seem to code it to copy and paste the tables / formats (as per header), only words get exported onto email outlook.
Can someone help me to tweek it please? Super appreciate it!
Code in question:
Private Sub CommandButton1_Click()
Dim outl As Object
Dim Mail As Object
Dim myrng As Range
Dim zelle As Range
Dim bodyX$
Set outl = CreateObject("Outlook.Application")
Set Mail = outl.CreateItem(olMailItem)
Set myrng = Sheets("test").Range("text")
Mail.To = Sheets("testF").Range("To")
Mail.CC = Sheets("test").Range("CC")
Mail.BCC = Sheets("test").Range("Bcc")
Mail.Subject = Sheets("test").Range("Subject").Value
For Each zelle In myrng
If Not zelle.Value = "" Then
bodyX = bodyX & zelle.Value & Chr(13)
Else:
bodyX = bodyX & Chr(13)
End If
Next zelle
Mail.Body = bodyX
Mail.Display
End Sub
I've got the following code below however I can't seem to code it to copy and paste the tables / formats (as per header), only words get exported onto email outlook.
Can someone help me to tweek it please? Super appreciate it!
Code in question:
Private Sub CommandButton1_Click()
Dim outl As Object
Dim Mail As Object
Dim myrng As Range
Dim zelle As Range
Dim bodyX$
Set outl = CreateObject("Outlook.Application")
Set Mail = outl.CreateItem(olMailItem)
Set myrng = Sheets("test").Range("text")
Mail.To = Sheets("testF").Range("To")
Mail.CC = Sheets("test").Range("CC")
Mail.BCC = Sheets("test").Range("Bcc")
Mail.Subject = Sheets("test").Range("Subject").Value
For Each zelle In myrng
If Not zelle.Value = "" Then
bodyX = bodyX & zelle.Value & Chr(13)
Else:
bodyX = bodyX & Chr(13)
End If
Next zelle
Mail.Body = bodyX
Mail.Display
End Sub