1
I have several cells I want to concatenate to send an email through excel
Turns out every cell I wish I had line breaks but I’m not getting
I’ve used Wraptext and Chr() but it’s not working, someone can help me?
Dim outapp As Outlook.Application
Dim outmail As Outlook.MailItem
Dim linha As Integer
Dim folha_origem As String
Dim listamails As String
Dim email As String
'cria e chama os objetos
Set outapp = CreateObject("outlook.application")
Set outmail = outapp.CreateItem(olMailItem)
linha = 7
folha_origem = "Contactos Experts"
'desativar a mensagem de alerta
Application.DisplayAlerts = False
email = ""
While Sheets(folha_origem).Cells(linha, 4).Value <> ""
listamails = listamails & ";" & Sheets(folha_origem).Cells(linha, 4).Value
email = email & Chr(10) & Sheets(folha_origem).Cells(linha, 6).Value
linha = linha + 1
Wend
linha = 7
With outmail
'email do destinatário
.To = listamails
'titluo da mensagem
.Subject = email
'mensagem
.HTMLBody = Sheets(folha_origem).Range("F7").Value
'enviar anexos que não existem
'.Attachments.Add = Range("dshf
.Display
' .Send
End With
Application.DisplayAlerts = True
Show me your code, because I’m getting it here normally.
– Rodrigo Rocha
@Rodrigorocha already added the code
– Ricarte