View Single Post
  #10   Report Post  
Posted to microsoft.public.word.tables
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default macro that repeats header rows of all tables?

The following won't be as quick, but will overcome that problem

Sub MakeHeadingRows()
Dim i As Long
With ActiveDocument
For i = 1 To .Tables.Count
.Tables(i).Cell(1, 1).Select
Selection.Rows.HeadingFormat = True
Next i
End With
End Sub


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

wrote in message
oups.com...
Thanks for the macro code. I did try the code and it worked well for
tables which did not have any merged cells. For tables with merged
cells it gave an error. How do we take care of such validations here?

My document has lot of tables and I want to repeat the table headers as
the tables span across pages and it is difficult to read. Some tables
have merged cells as well.

Can a macro handle these scenarios and repeat table headers for valid
tables only?


Doug Robbins - Word MVP wrote:
The following macro will do it:

Sub MakeHeadingRows()
Dim i As Long
With ActiveDocument
For i = 1 To .Tables.Count
.Tables(i).Rows(1).HeadingFormat = True
Next i
End With
End Sub


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Tom" wrote in message
oups.com...
Does anyone know how to make a macro that repeats the header row of
tables that span multiple pages? This is done by selecting the table
and going to Table Heading Rows repeat. If I have a document with 20
tables, I would like to automate this via a macro, but I'm not sure
how.