Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.tables
|
|||
|
|||
macro that repeats header rows of all tables?
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. |
#2
Posted to microsoft.public.word.tables
|
|||
|
|||
macro that repeats header rows of all tables?
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. |
#3
Posted to microsoft.public.word.tables
|
|||
|
|||
macro that repeats header rows of all tables?
Use the HeadingFormat property (defined for Row objects). For example,
to set the first row of all tables in the active document to be heading rows, use a macro such as the following: Sub test() Dim t As Table For Each t In ActiveDocument.Tables t.Rows(1).HeadingFormat = True Next t End Sub -- Stefan Blom Microsoft 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. |
#4
Posted to microsoft.public.word.tables
|
|||
|
|||
macro that repeats header rows of all tables?
Thanks! The macro worked perfectly. I also wanted to indent the tables,
so I added another parameter in there from a different macro. Sub Fixmytables() Dim t As Table For Each t In ActiveDocument.Tables t.Rows(1).HeadingFormat = True t.Rows.LeftIndent = CentimetersToPoints(2.9) Next t End Sub Can you tell me where I would find all the parameters that I can apply for tables? Thanks for your help. |
#5
Posted to microsoft.public.word.tables
|
|||
|
|||
macro that repeats header rows of all tables?
Thanks! The macro worked perfectly. I also wanted to indent the tables,
so I added another parameter in there from a different macro. Sub Fixmytables() Dim t As Table For Each t In ActiveDocument.Tables t.Rows(1).HeadingFormat = True t.Rows.LeftIndent = CentimetersToPoints(2.9) Next t End Sub Can you tell me where I would find all the parameters that I can apply for tables? Thanks for your help. |
#6
Posted to microsoft.public.word.tables
|
|||
|
|||
macro that repeats header rows of all tables?
Thanks! The macro worked perfectly. I also wanted to indent the tables,
so I added another parameter in there from a different macro. Sub Fixmytables() Dim t As Table For Each t In ActiveDocument.Tables t.Rows(1).HeadingFormat = True t.Rows.LeftIndent = CentimetersToPoints(2.9) Next t End Sub Can you tell me where I would find all the parameters that I can apply for tables? Thanks for your help. |
#7
Posted to microsoft.public.word.tables
|
|||
|
|||
macro that repeats header rows of all tables?
Thanks! The macro worked perfectly. I also wanted to indent the tables,
so I added another parameter in there from a different macro. Sub Fixmytables() Dim t As Table For Each t In ActiveDocument.Tables t.Rows(1).HeadingFormat = True t.Rows.LeftIndent = CentimetersToPoints(2.9) Next t End Sub Can you tell me where I would find all the parameters that I can apply for tables? Thanks for your help |
#8
Posted to microsoft.public.word.tables
|
|||
|
|||
macro that repeats header rows of all tables?
Read about the Table object in Word VBA Help. Or use the Object
Browser (press F2 with the Visual Basic Editor displayed). There you can view objects, their properties and methods, and use F1 to display help on specific items. -- Stefan Blom Microsoft Word MVP "Tom" wrote in message ps.com... Thanks! The macro worked perfectly. I also wanted to indent the tables, so I added another parameter in there from a different macro. Sub Fixmytables() Dim t As Table For Each t In ActiveDocument.Tables t.Rows(1).HeadingFormat = True t.Rows.LeftIndent = CentimetersToPoints(2.9) Next t End Sub Can you tell me where I would find all the parameters that I can apply for tables? Thanks for your help |
#9
Posted to microsoft.public.word.tables
|
|||
|
|||
macro that repeats header rows of all tables?
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. |
#10
Posted to microsoft.public.word.tables
|
|||
|
|||
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. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro name different in Organizer | Microsoft Word Help | |||
I can't get header rows to repeat in tables. | Tables | |||
Tables take up room in header when crossing pages | Microsoft Word Help | |||
wordcount macro for tables and brackets | Tables | |||
Two rows repeating as header row | Tables |