Link to home
Start Free TrialLog in
Avatar of Andreas Hermle
Andreas HermleFlag for Germany

asked on

Run macro on tables where specific cells are blank.

Dear Experts,

can somebody help me re-write this code so that ...
... only tables get worked on where the 2nd and 3nd cell in the first row are blank, i.e. Cell(Row:=1;Column:=2) and Cell(Row:=1;Column:=3) are blank.

Help is much appreciated. Thank you very much in advance.

Regards, Andreas

Sub Format_First_Row_All_Tables

Dim tbl as table

For Each tbl In ActiveDocument.Tables
        With tbl.rows.First
            .Range.Font.Name = "Verdana"
            .Range.Font.Size = 7.5
            .Range.Font.Bold = True
            .Shading.BackgroundPatternColor = wdColorGray25
            .HeadingFormat = True
            .HeightRule = wdRowHeightAtLeast
            .Height = CentimetersToPoints(0.9)
        End With
 Next tbl

End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of GrahamSkan
GrahamSkan
Flag of United Kingdom of Great Britain and Northern Ireland 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
Avatar of Andreas Hermle

ASKER

Hi Graham,

great, this did the trick. Thank you very much for your professional and swift support.

Regards, Andreas