We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Dim tbl As Table Dim rw As Row Dim cl As Cell Dim c As Integer Dim iStartCol As Integer Dim StartDate, EndDate, MyDate As Date StartDate = CDate(ActiveDocument.CustomDocumentProperties.Item("xBeginDate")) EndDate = CDate(ActiveDocument.CustomDocumentProperties.Item("xEndDate")) iStartCol = 1 Set tbl = ActiveDocument.Tables(1) 'Add rows for each day from StartDate to EndDate Do While StartDate <= EndDate 'if date is a weekend then do nothing If IsWeekend(StartDate) = True Then Else Set rw = tbl.Rows.Add c = iStartCol rw.Cells(c).Range.Text = Format(StartDate, "dddd, d mmmm") End If StartDate = StartDate + 1 Loop End Sub Public Function IsWeekend(InputDate As Date) As Boolean Select Case Weekday(InputDate) Case vbSaturday, vbSunday IsWeekend = True Case Else IsWeekend = False End Select End Function
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.