Notifications
Clear all

Enviar Range com a mesma formatação do excel para o outlook

3 Posts
2 Usuários
0 Reactions
914 Visualizações
(@ueversonl)
Posts: 4
New Member
Topic starter
 

Pessoal preciso fazer com que esta range vai com a mesma formatação para o e-mail
Help!


Sub EnviarEmail()

Dim rng As Range
Dim OutApp As Object
Dim OutMail As Object

emailpara = Sheets("Mapa").Range("B5").Value
emailcopia = Sheets("Mapa").Range("B6").Value
emailTitulo = Sheets("Mapa").Range("B3").Value

Set rng = Nothing
On Error Resume Next

Set rng = Sheets("E-mail").Range("b3:Q37").SpecialCells(xlCellTypeVisible)
On Error GoTo 0

If rng Is Nothing Then
MsgBox "The selection is not a range or the sheet is protected" & _
vbNewLine & "please correct and try again.", vbOKOnly
Exit Sub
End If

With Application
.EnableEvents = False
.ScreenUpdating = False
End With

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next
With OutMail
.To = emailpara
.CC = emailcopia
.BCC = ""
.Subject = emailTitulo
.HTMLBody = Sheets("E-mail").Range("S1") + RangetoHTML(rng)
.display

End With
On Error GoTo 0

With Application
.EnableEvents = True
.ScreenUpdating = True
End With

Set OutMail = Nothing
Set OutApp = Nothing
End Sub

 
Postado : 16/06/2016 6:12 am
Wagner Morel
(@wagner-morel-vidal-nobre)
Posts: 0
Illustrious Member
 

UeversonL,

Bom dia!

Segue exemplo que faz o que você quer. Faça as necessárias adaptações que o mesmo servirá para atender as suas necessidades. Esse exemplo foi desenvolvido pelo pessoal do site saberexcel. Todos os crédito são deles.

Veja se o mesmo lhe atende.

Desenvolvo pequenas soluções em VBA Excel a valores que variam entre R$ 50,00 a R$ 200,00. Se te interessar, entre no meu instagran (vba_excel_desenvolvimento)

Atenciosamente
Wagner Morel

 
Postado : 16/06/2016 6:27 am
(@ueversonl)
Posts: 4
New Member
Topic starter
 

Muito Bom, porem par formatação condicional "Barras de dados" ela não aparece

 
Postado : 16/06/2016 6:42 am