ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Spreadsheet To Auto Generate Monthly Calendar (https://www.excelbanter.com/excel-programming/355962-spreadsheet-auto-generate-monthly-calendar.html)

ATL10SPRO

Spreadsheet To Auto Generate Monthly Calendar
 
Good Morning Everyone,

Has anyone come across an Excel generated monthly calendar updated
using data stored in an Excel spreadsheet? For example, let's say I
have a column with the date 16-Mar-06. Under the date column I have
the task "Attend Propulsion Mtg." I would like to see a montly
calendar for March created and the task "Attend Propulsion Mtg." placed
in the box for the day (16 March). I may have additional tasks for
the same day. The calendar will need to display them all. If it would
be easier, I already have a monthly calendar created. I just do not
know how to programmatically place the task in the corresponding
calendar box for a particular day.

The data containing the date and task can be placed as a column/column;
column/row; row/row. It does not matter. I can change the spreadsheet
to meet your recommendations.

Your assistance is greatly appreciated.

Thank you!

Edwin


Tom Ogilvy

Spreadsheet To Auto Generate Monthly Calendar
 
assume the date is in A1 of Sheet1 and below it are any events you want
entered. Assume each sheet has the name of the month (spelled out). that
the calendar starts in column A with each day being composed of 1 column and
multiple rows. That each day will have enough rows to accomodate any events.
That the numeric day of that month is in the first row of the day and it is
a number (1 to 31)

Sub ProcessDate()
Dim rng as Range, cell as Range
Dim sMth as String, lastrow as Long, j as Long
Dim i as Long
set rng = Worksheets("Sheet1").Range("A1") ' date
sMth = format(rng.Value,"MMMM")

With Worksheets(sMth)
lastrow = .cells(rows.count,1).End(xlup).row
for i = lastrow to 1 step -1
if isnumeric(.cells(i,1)) then
if day(rng) = .cells(i,1) and day(rng) <= .cells(i,1)+7 then
set cell = .cells(i,day(rng)-.cells(i,1))
j = 2
do while not isempty(rng(j))
cell(j) = rng(j)
j = j + 1
Loop
end if
end if
Next
End Sub

code is untested and represents a possible approach and a structure. It may
contain typos or logic errors. Alter it to suit your situation.

--
Regards,
Tom Ogilvy




"ATL10SPRO" wrote:

Good Morning Everyone,

Has anyone come across an Excel generated monthly calendar updated
using data stored in an Excel spreadsheet? For example, let's say I
have a column with the date 16-Mar-06. Under the date column I have
the task "Attend Propulsion Mtg." I would like to see a montly
calendar for March created and the task "Attend Propulsion Mtg." placed
in the box for the day (16 March). I may have additional tasks for
the same day. The calendar will need to display them all. If it would
be easier, I already have a monthly calendar created. I just do not
know how to programmatically place the task in the corresponding
calendar box for a particular day.

The data containing the date and task can be placed as a column/column;
column/row; row/row. It does not matter. I can change the spreadsheet
to meet your recommendations.

Your assistance is greatly appreciated.

Thank you!

Edwin



ATL10SPRO

Spreadsheet To Auto Generate Monthly Calendar
 
Thank you Tom!



All times are GMT +1. The time now is 01:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com