View Single Post
 
Old 04-30-2012, 08:26 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Hi umesh,

Change:
If bDel = True Then .Delete
to:
If bDel = True And i > 1 Then .Delete

The code does not select any table. What it does is to loop through the table objects collection, looking for tables whose first cell has the word 'Date' or 'Period'. All of that is managed by:
Code:
  For Each oTbl In .Tables
    With oTbl
      Set Rng = .Cell(1, 1).Range
      Rng.End = Rng.End - 1
      If UCase(Rng.Text) <> "DATE" And UCase(Rng.Text) <> "PERIOD" Then GoTo NextTable
As for the unwanted colouring, that has been applied via shading, not by highlighting.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote