XL 2016 Comment récupérer les données d'un tableau excel vers un espace Powerpoint

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 !

melltel

XLDnaute Occasionnel
Bonjour,
s'il vous plait, j'aimerai savoir comment récupérer les commentaires du tableau excel pour les copier vers un espace dans une slide Powerpoint (espace commentaires) avec la condition de prendre que des case remplies
je joins ici mes fichiers.
Merci
 

Pièces jointes

Dernière édition:
Solution
Dans PowerPoint j'ai agrandi la Shape "espaceCom" et l'ai placée dans "Descriptif".

La macro du bouton dans le fichier Excel :
VB:
Sub PPT()
Dim c As Range, texte$, PPApp
For Each c In [Tableau1].Columns(2).Cells
    If c <> "" Then texte = texte & vbLf & c
Next
texte = Mid(texte, 2)
Set PPApp = CreateObject("PowerPoint.Application")
PPApp.Visible = True
PPApp.Presentations.Open ThisWorkbook.Path & "\PrésentationPPT.pptx"
PPApp.ActivePresentation.Slides(1).Shapes("espaceCom").TextFrame2.TextRange = texte
AppActivate PPApp.Caption 'active PP
End Sub
Bonjour Melltel
Non testé.

VB:
Sub Slides()
Dim sld
Dim shp As Shape
Dim AllComments As String

Set sld = ActivePresentation.Slides(1)
Dim xlApp As Excel.Application
Set xlApp = CreateObject("Excel.Application")
Dim dlgOpen As FileDialog

    Set dlgOpen = Application.FileDialog( _
        Type:=msoFileDialogOpen)

    With dlgOpen
        .AllowMultiSelect = True
        .Show
    End With

xlApp.Visible = True

xlApp.Workbooks.Open dlgOpen.SelectedItems(1), True, False
Dim sh As Worksheet
Set sh = ThisWorkbook.Sheets(1)
Dim oComment  As Comment
For Each oComment In sh.Comments
  AllComments = AllComments + " " + oComment.Text

Next
For Each shp In sld.Shapes
  Debug.Print shp.Name
  If shp.TextFrame.TextRange.Text = "Commentaire" Then
    Exit For
  End If
Next
shp.TextRange.Text = AllComments
Set xlApp = Nothing
End Sub
 
Dans PowerPoint j'ai agrandi la Shape "espaceCom" et l'ai placée dans "Descriptif".

La macro du bouton dans le fichier Excel :
VB:
Sub PPT()
Dim c As Range, texte$, PPApp
For Each c In [Tableau1].Columns(2).Cells
    If c <> "" Then texte = texte & vbLf & c
Next
texte = Mid(texte, 2)
Set PPApp = CreateObject("PowerPoint.Application")
PPApp.Visible = True
PPApp.Presentations.Open ThisWorkbook.Path & "\PrésentationPPT.pptx"
PPApp.ActivePresentation.Slides(1).Shapes("espaceCom").TextFrame2.TextRange = texte
AppActivate PPApp.Caption 'active PP
End Sub
 

Pièces jointes

- 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
10
Affichages
513
Retour