Hi- yes, the operation must be performed on a selected table. I've actually
already disabled the screen updates (which helped speed things up), but the
individual deletion of rows is still incredibly slow given the number of rows
and tables.
Any way to delete the rows at the same time? I think in Excel it is possible
but is it not in PowerPoint?
> > Hello,
> >
[quoted text clipped - 27 lines]
> PPTools: www.pptools.com
> ================================================
John Wilson - 13 May 2008 10:58 GMT
Just an aside really. Does your code actually delete rows 2 -10?
I would expect it to delete 2,4,6,8,10 etc

Signature
-------------------------------------------
Amazing PPT Hints, Tips and Tutorials
http://www.PPTAlchemy.co.uk
http://www.technologytrish.co.uk
email john AT technologytrish.co.uk
> Hi- yes, the operation must be performed on a selected table. I've actually
> already disabled the screen updates (which helped speed things up), but the
[quoted text clipped - 35 lines]
> > PPTools: www.pptools.com
> > ================================================
Iorav Marz - 13 May 2008 14:16 GMT
Actually, the full code I am using has variables in place for "2" and "10"...
it really depends on the table. I put in "2-10" to simplify the example.
So does anyone know a way of deleting these rows at the same time?
Thanks.
> Just an aside really. Does your code actually delete rows 2 -10?
>
[quoted text clipped - 39 lines]
> > > PPTools: www.pptools.com
> > > ================================================
Steve Rindsberg - 13 May 2008 17:28 GMT
> Hi- yes, the operation must be performed on a selected table.
Try storing a reference to the table in a variable then deselecting it.
Do your work on the unselected table, then reselect it if need be.
I don't know of any way to delete multiple rows at a time (though that shouldn't be
taken as proof that it's not possible! <g>)
I've actually
> already disabled the screen updates (which helped speed things up), but the
> individual deletion of rows is still incredibly slow given the number of rows
[quoted text clipped - 34 lines]
> > PPTools: www.pptools.com
> > ================================================
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Iorav Marz - 13 May 2008 18:41 GMT
Hi Steve and thanks for the help. The macro runs through all tables in the
PowerPoint presentation and deletes rows based on their position on the
slide. Once the macro is finished with a tables, it then moves to the next
slide and performs the operation on the next table. It continues doing this
until it reaches the end of the presentation.
Could you please expand on your recommendation to "storing a reference to
the table in a variable then deselecting it" and "do your work on the
unselected table, then reselect it if need be"? I'm unclear as to how that
will help me in this case.
I've isolated the row deletion portion of the macro because it is the one
piece of code that is significantly slowing it down. If anyone could identify
a way to delete rows on a table at the same time rather than cycling through
them individually, I would greatly appreciate it!
> > Hi- yes, the operation must be performed on a selected table.
>
[quoted text clipped - 49 lines]
> PPTools: www.pptools.com
> ================================================
Steve Rindsberg - 14 May 2008 00:03 GMT
> Hi Steve and thanks for the help. The macro runs through all tables in the
> PowerPoint presentation and deletes rows based on their position on the
[quoted text clipped - 6 lines]
> unselected table, then reselect it if need be"? I'm unclear as to how that
> will help me in this case.
So it really doesn't rely on the current table being selected.
Try something along these lines. The logic for which row to delete is ugly and wrong for
your needs but the whole thing runs fairly quickly.
Sub DelRows()
Dim oSl As Slide
Dim oSh As Shape
Dim oTbl As Table
Dim lRow As Long
For Each oSl In ActivePresentation.Slides
For Each oSh In oSl.Shapes
If oSh.HasTable Then
Set oTbl = oSh.Table
With oTbl
If .Rows.Count > 2 Then
For lRow = .Rows.Count To 1 Step -2
.Rows(lRow).Delete
Next
End If
End With
End If
Next
Next
End Sub
> I've isolated the row deletion portion of the macro because it is the one
> piece of code that is significantly slowing it down. If anyone could identify
[quoted text clipped - 54 lines]
> > PPTools: www.pptools.com
> > ================================================
-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Iorav Marz - 14 May 2008 14:26 GMT
Hi Steve,
Actually the macro already works on unselected tables... the part that is
really slowing it down is the individual deletion of rows.
Could there be a way to delete these rows at the same time through VBA?
Since I can manually select multiple rows in a PowerPoint table, right click
on the table rows, and select "Delete Rows", I was hoping there was a way to
do this through VBA as well.
Thanks.
> > Hi Steve and thanks for the help. The macro runs through all tables in the
> > PowerPoint presentation and deletes rows based on their position on the
[quoted text clipped - 101 lines]
> PPTools: www.pptools.com
> ================================================