Link to home
Start Free TrialLog in
Avatar of brothertruffle880
brothertruffle880Flag for United States of America

asked on

word 2013 VBA - Macro Needed to 1) Find Table, 2) select first row, 3) Change font size of first row to 16 pt and font to Arial Bold

Hi All:
I have 40 or so tables in a document which need to be modified.
I need a macro to
1) Find a Table,
2) select the first row in that table,
3) Change the font size of that table's first row to 16 pt and the font to Arial Bold
4) Repeat Step 1 2 and 3 until the end of the  document is reached.
5) Generate a message box saying "Done.".
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Please give this a try...


Sub FormatTableRow()
Dim doc As Document
Dim tbl As Table

Set doc = ActiveDocument
For Each tbl In doc.Tables
    With tbl.Rows(1).Range.Font
        .Bold = True
        .Size = 16
        .Name = "Arial"
    End With
Next tbl
MsgBox "Done!", vbInformation
End Sub

Open in new window

Avatar of brothertruffle880

ASKER

Hi Neeraj:
The macro is fine but I would like to see each table as it is being processed.
The macro is fine but I would like to see each table as it is being processed.
What do you mean by that? You cannot see the progress of the macro as it will complete the task in almost milliseconds.
Hi Sudobh:
I'm running the macro using f8 I'd like to see each table.
Currently my screen remains on page 1. Where the first table is positioned.
ASKER CERTIFIED SOLUTION
Avatar of Subodh Tiwari (Neeraj)
Subodh Tiwari (Neeraj)
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
FLAWLESS!!!  Perfect!!!!
Thank you.
You're welcome!
Thanks for the feedback.