Guides - MS-Excel97
Model
Demonstrates: Formatting, Formulae, VBasic
![]()
|
Creating the calendar.
Change the date in A1 for a new calendar. |
|
Displaying data in the calendar
|
| Sub FillDays() Dim PeopleDates, CalendarDays As Range 'Identify the calendar cells to fill, and the database Set CalendarDays = Worksheets("Calendar").Range("CalendarDays") Set PeopleData = Worksheets("ListLookup").Range("A2:b25") 'Do the following for each cell in the calendar For Each c1 In CalendarDays.Cells 'Do the following for each date in the list For Each c2 In PeopleData.Resize(PeopleData.Rows.Count, 1) 'If the current date in teh list matches the current calendar day If c1.Offset(-1, 0).Value = c2.Value Then '.. enter the corresponding list item into the calendar c1.Formula = c2.Offset(0, 1).Formula End If Next c2 Next c1 End Sub |
|
Note: the worksheet has been slightly modified from original. |
[Rev 8/2/98] 8/2/98 © 1998 V/2-Com (Verhaart), P O Box 8415, Havelock North, New Zealand.