• Delete Table rows (W2000, 9.0 SR-1)

    Author
    Topic
    #362180

    I am very anxious to know how I can delete table rows no. e.g. 4 and 5 and then no. 16, 17 and 18 in the same table.

    Deleting consecutive rows are OK but not as described above.

    Thanks for any help!

    Regards
    Bj

    Viewing 0 reply threads
    Author
    Replies
    • #549384

      Hi Bjorn,

      You should be able to delete the rows by referring to them by index number i.e.:

      ActiveDocument.Tables(1).Rows(4).Delete

      But keeping the count correct gets tricky if you delete from the top down (since the row index will keep changing).
      Instead, try deleting the rows in reverse order that is first row 18, then row 17 etc.

      Gary

      • #549387

        Thanks Gary,

        Then I need to write a procedure for it and that could be the best way in the long run.

        I was thinking that it might be possible e.g. to mark the different rows as one do it in Win Explorer to delete different files.

        Regards
        Bj

        • #549389

          Sorry Bjorn – since I know you do VBA I was assuming you were looking for a VBA solution!

          But in any case you can’t do as you say: select non-contiguous rows in a Word table and delete them. I haven’t worked with Word 2002; possibly it’s possble there (recollect reading that it’s possible to do non-contiguous selections with Word XP, but not via code….)

          Gary

          • #549463

            Hi Gary,

            Thanks a lot. I thought that was the case. Had to be sure and therefore ask real competent people.

            I think over if it is worth the work to write a VBA procedure for this.

            Thanks again.

            Best regards
            Bj

    Viewing 0 reply threads
    Reply To: Delete Table rows (W2000, 9.0 SR-1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: