Bonjour à tous, j'utilise le code suivant pour envoyer de l'info d'une feuille excel par Outlook. J'aimerais pouvoir coller mon tableau croisé dynamique directement dans Outlook.
Des idées pour coller la région sélectionné et préalablement copié?
Merci
HTML:
Sub email()
Dim strCommandePasrendu As String
Dim strPretatester As String
Dim strATester As String
Dim strEnTraitement As String
Dim strAfaire As String
Dim strAttenteCommande As String
Dim strSupportAttente As String
Dim rwindex As Integer
Dim strResult As String
Dim a As Integer
Range("Table_follow_up7[[#Headers],[rmad_rmaid]]").Select
Selection.CurrentRegion.Select
Selection.Copy
a = Sheets("follow up Support").Range("A2").CurrentRegion.Rows.Count
For rwindex = 3 To a
If Sheets("follow up Support").Cells(rwindex, 20).Value = "Commande pas rendu" Then
strCommandePasrendu = strCommandePasrendu + Sheets("follow up").Cells(rwindex, 2).Value + vbCr
End If
If Sheets("follow up").Cells(rwindex, 20).Value = "Prêt à livrer" Then
strPretatester = strPretatester + Sheets("follow up").Cells(rwindex, 2).Value + vbCr
End If
If Sheets("follow up").Cells(rwindex, 20).Value = "A tester" Then
strATester = strATester + Sheets("follow up").Cells(rwindex, 2).Value + vbCr
End If
If Sheets("follow up").Cells(rwindex, 20).Value = "En traitement (calibration)" Then
strEnTraitement = strEnTraitement + Sheets("follow up").Cells(rwindex, 2).Value + vbCr
End If
If Sheets("follow up").Cells(rwindex, 20).Value = "A faire" Then
strAfaire = strAfaire + Sheets("follow up").Cells(rwindex, 2).Value + vbCr
End If
If Sheets("follow up").Cells(rwindex, 20).Value = "Attente commande" Then
strAttenteCommande = strAttenteCommande + Sheets("follow up").Cells(rwindex, 2).Value + vbCr
End If
If Sheets("follow up").Cells(rwindex, 20).Value = "Support attente" Then
strSupportAttente = strSupportAttente + Sheets("follow up").Cells(rwindex, 2).Value + vbCr
End If
Next rwindex
strmessage = _
"COMMANDE pas rendu:" + vbCr + strCommandePasrendu + vbCr _
+ "PRET A LIVRER:" + vbCr + strPretatester + vbCr _
+ "A TESTER:" + vbCr + strATester + vbCr _
+ "EN TRAITEMENT:" + vbCr + strEnTraitement + vbCr _
+ "A FAIRE:" + vbCr + strAfaire + vbCr _
+ "ATTENTE COMMANDE:" + vbCr + strAttenteCommande + vbCr _
+ "Resultat:" + vbCr + strResult + vbCr _
+ "SUPPORT Attente:" + vbCr + strSupportAttente + vbCr
'Selection.Paste
Dim appOL As New Outlook.Application
Dim appOL_Mail As MailItem
Set appOL = Outlook.Application
Set appOL_Mail = appOL.CreateItem(olMailItem)
With appOL_Mail
.Display
.To = "" + ";" + "" + ";" + ""
.CC = ""
.Subject = "Statut RMA Support"
.Body = strmessage + .Body
.BodyFormat = olFormatHTML
End With
End Sub
Des idées pour coller la région sélectionné et préalablement copié?
Merci