Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 11-07-2012, 02:04 PM
macropod's Avatar
macropod macropod is offline Word Macro to find and delete rows that contain adjacent cells containing "." Windows 7 64bit Word Macro to find and delete rows that contain adjacent cells containing "." Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,384
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

Try:
Code:
Sub Demo()
Dim i As Long, j As Long, Rng1 As Range, Rng2 As Range
With ActiveDocument
  For i = .Tables.Count To 1 Step -1
    With .Tables(i)
      For j = .Rows.Count To 1 Step -1
        With .Rows(j)
          Set Rng1 = .Cells(1).Range
          Rng1.End = Rng1.End - 1
          Set Rng2 = .Cells(2).Range
          Rng2.End = Rng2.End - 1
          If Rng1.Text = "." Then
            If Rng2.Text = "." Then
              .Delete
            End If
          End If
        End With
      Next
    End With
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Tags
delete, macro, table



Similar Threads
Thread Thread Starter Forum Replies Last Post
In Excel 2007-After Selecting Visibe Cells-How do I "Copy to Visible cells" Only mag Excel 0 10-28-2012 08:04 PM
How to "hard link" two adjacent cells to a data validation drop down list? Geza59 Excel 10 10-19-2012 11:56 AM
'Linking' entered information to other "cells" from an original "cell" in MS Word Wade Word 6 09-03-2012 05:22 PM
Word Macro to find and delete rows that contain adjacent cells containing "." Macro to delete rows with all empty cells ubns Excel Programming 2 08-14-2012 02:01 AM
Automated "Macro" to delete Tags/Anchors field3 Word VBA 0 02-25-2009 02:53 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:04 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