Results 1 to 6 of 6

Thread: [PowerPoint] Delete multiple rows in a table at once using VBA

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2012
    Location
    Recently moved from Europe to Panama
    Posts
    292

    [PowerPoint] Delete multiple rows in a table at once using VBA

    Hi,

    Anyone can help me how to delete multiple rows in a PowerPoint table at once using VBA?

    Background info:

    I've created a VBA macro that deletes rows from a table on a PowerPoint slide. It's part of a larger macro that "splits" a table that doesn't fit on a single slide over multiple slides. (The table is generated outside PowerPoint.)

    The base process is that it copies the slide with the too long table the required number of times, and then removes the rows that don't apply to that slide. E.g. the table has 75 rows, and I want 25 per slide. The original slide is copied 2x, so that there are 3 slides with the full table. On the first we delete rows 26-75, on the second we delete rows 1-25 and 51-75, and on the third slide rows 1-50.

    This works fine for small tables, but a table with 265 rows that has to be split over 10 slides, already takes us 5 minutes to process. On an Intel i9 with 64GB RAM... On an Intel i5 it takes up more than 20 minutes!

    The slow part is related to the fact that each row is deleted individually, which apparently creates significant overhead. Because if I manually select 200+ rows, right mouse click, and say delete rows, it only takes a second or two.

    Unfortunately I have not been able to find a way to delete multiple rows at once. The Delete-method seems to allow one row-number only, and not a range like e.g. Excel. I thought about selecting multiple rows or cells, but the Selected property is read-only. I thought about setting the row-height to 0, but that doesn't work if there is data in the cells.

    Hopefully somebody has an idea!

    Thanks in advance,
    Erwin
    Last edited by Erwin69; May 17th, 2020 at 04:24 AM. Reason: Adding the requested [PowerPoint] tag in the title

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width