VBA to select a tables and perform an operation in PowerPoint

I

IoravMarz

Hello- to anyone that can help...

I have written some VBA code that performs an operation on a PPT table
once
it is selected. I would like to apply this operation to all tables
within a
PowerPoint file that is open. I am having trouble writing code that
selects
tables within the PPT file. The file includes multiple tables on
multiple
slides. Not all slides have tables.

The code should:
1) Select the first table on the first slide that has a table
2) Run the operation on the table
3) Select the next table in the PowerPoint (may or may not be on the
same
slide)
4) Run the operation on that table
5) Keep selecting and running the operation on all successive tables

I would greatly appreciate any help here... been trying for days!
 
J

John Wilson

Pretty well whatever it is I doubt if you should select the table. Try
something like:

Sub dothis()
Dim osld As Slide
Dim oshp As Shape
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.Type = msoTable Then
'Do whatever
End If
Next oshp
Next osld
End Sub
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 
I

Iorav Marz

John- this is perfect! Thanks for your help.


John Wilson said:
Pretty well whatever it is I doubt if you should select the table. Try
something like:

Sub dothis()
Dim osld As Slide
Dim oshp As Shape
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
If oshp.Type = msoTable Then
'Do whatever
End If
Next oshp
Next osld
End Sub
--
Amazing PPT Hints, Tips and Tutorials

http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top