-
Here's some code to play around with. You can use styles or code as desired.
[VBA]
Sub Formats()
Dim Rw As Long, Col As Long
With ActiveDocument.Tables(1)
Rw = .Rows.Count
Col = .Columns.Count
.Cell(1, 1).Select
Selection.Style = ActiveDocument.Styles("Heading 1")
For j = 2 To Col
.Cell(1, j).Select
MyFont
Bold
Centre
Next
For i = 2 To Rw
For j = 1 To Col
.Cell(i, j).Select
MyFont
Next
Next
End With
End Sub
Sub Bold()
With Selection.Font
.Name = "Times New Roman"
.Size = 12
.Bold = True
.Italic = True
End With
End Sub
Sub Centre()
Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
End Sub
Sub MyFont()
With Selection.Font
.Name = "Courier"
.Size = 11
End With
End Sub
[/VBA]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules