Coller TCD dans outlook

  • Initiateur de la discussion Initiateur de la discussion adinnn
  • Date de début Date de début

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

adinnn

XLDnaute Occasionnel
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.

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
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
5
Affichages
243
Réponses
4
Affichages
180
Réponses
2
Affichages
203
Réponses
5
Affichages
233
  • Question Question
Microsoft 365 worksheet_change
Réponses
29
Affichages
482
Réponses
2
Affichages
154
Retour