Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-11-2012, 04:30 PM
macropod's Avatar
macropod macropod is offline Delete all rows but the last. Windows 7 64bit Delete all rows but the last. Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case, try:
Code:
Sub DelTableRows()
Application.ScreenUpdating = False
Dim Tbl As Table, i As Long
With ActiveDocument
  For Each Tbl In .Tables
    For i = (Tbl.Rows.Count - 1) To 1 Step -1
      Tbl.Rows(i).Delete
    Next
  Next Tbl
End With
Application.ScreenUpdating = True
End Sub
PS: When posting code, please use the code tags. They're on the 'Go Advanced' tab.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete all rows but the last. Macro to delete all empty rows from all tables braddgood Word VBA 15 10-02-2015 01:54 PM
Delete all rows but the last. Macro to conditionally delete rows Steve_D Excel 2 08-24-2012 09:37 PM
Delete all rows but the last. Macro to delete rows with all empty cells ubns Excel Programming 2 08-14-2012 02:01 AM
Delete all rows but the last. merging rows and creating sub-rows gib65 Excel 2 12-09-2011 02:09 PM
delete email message via blackberry and have it delete on my pop3 and my outlook Iamthestorm Outlook 2 10-28-2010 12:21 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:05 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft