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.".
brothertruffle880Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
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

0
brothertruffle880Author Commented:
Hi Neeraj:
The macro is fine but I would like to see each table as it is being processed.
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
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.
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

brothertruffle880Author Commented:
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.
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
Okay try this...
Sub FormatTableRow()
Dim doc As Document
Dim tbl As Table

Set doc = ActiveDocument
For Each tbl In doc.Tables
    tbl.Rows(1).Select
    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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
brothertruffle880Author Commented:
FLAWLESS!!!  Perfect!!!!
Thank you.
0
Subodh Tiwari (Neeraj)Excel & VBA ExpertCommented:
You're welcome!
Thanks for the feedback.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.