709-218-7927

The Landfall Garden House

60 Canon Bayley Road

CANADA A0C 1B0

CPRGreaves@gmail.com

Home

Christopher Greaves

Error! Not a valid filename.

Calendar Tricks

Under.zip (XCalendar) "Calendar" - Generates a calendar in a manner far superior to Microsoft's method.

You like using the Calendar macro. You decide to print off a fresh calendar every month.

Here's what you can do to ease your workload even further:

Christopher Greaves Under_Calendar_013.JPG

Save a fresh calendar with a name like "Calendar", so you'll be able to find it again.

Open up the Visual Basic Editor (Tools, Macros, Visual Basic Editor).

In the VBE set a reference to UnderTheHood by choosing Tools, References.

In the module This Document, write or generate a short macro that will call the calendar macro each time the document is opened.

Private Sub Document_Open()
Dim dt As Date
dt = DateSerial(Year(Now()), Month(Now()), 1)
Call Under.XCalen.GenerateCalendarTable(dt, Selection.Tables(1))
End Sub

You can paste that code directly into the module, if you wish.

(Choose Debug, Compile to check that you have no syntax errors)

Save and Close the Calendar document.

The next time you open Calendar.DOC, the calendar will be refreshed with the calendar for the current month.

If you are in the habit of printing off next month's calendar sometime in the last seven (7) days of the current month, you can fudge the date calculation like this:

dt = DateSerial(Year(Now() + 7), Month(Now() + 7), 1)

What’s next?

Then come back here for more!

709-218-7927 CPRGreaves@gmail.com

Bonavista, Thursday, December 17, 2020 7:34 AM

Copyright © 1996-2020 Chris Greaves. All Rights Reserved.