View Single Post
 
Old 10-19-2025, 02:51 PM
macropod's Avatar
macropod macropod is online now Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,489
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

For example:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim Tbl As Table, c As Long, r As Long, ArrDays, ArrMeals
ArrDays = Array("", "", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat", "Sun"): ArrMeals = Array("", "", "LUNCH", "DINNER")
With ActiveDocument.Range
  .Font.Size = 18: .Font.Bold = True: .ParagraphFormat.Alignment = wdAlignParagraphCenter
  .Text = "WEEKLY MENU" & vbCr & vbCr & vbCr
  Set Tbl = .Tables.Add(Range:=.Characters.Last, Numrows:=3, NumColumns:=8)
End With
With Tbl
  .Style = "Grid Table 5 Dark - Accent 6"
  .Range.Font.Size = 10: .Range.Font.Name = "Arial": .Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
  For c = 2 To 8: .Cell(1, c).Range.Text = ArrDays(c): Next
  For r = 2 To 3: .Cell(r, 1).Range.ParagraphFormat.Alignment = wdAlignParagraphLeft: .Cell(r, 1).Range.Text = ArrMeals(r): Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote