Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Delete Table rows (W2000, 9.0 SR-1)

    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

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Delete Table rows (W2000, 9.0 SR-1)

    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

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Delete Table rows (W2000, 9.0 SR-1)

    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

  4. #4
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Delete Table rows (W2000, 9.0 SR-1)

    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

  5. #5
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Delete Table rows (W2000, 9.0 SR-1)

    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

Posting Permissions

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