A way for make a calendar

Leandroarb

Board Regular
Joined
Oct 7, 2014
Messages
157
Hi guys!


I share this file here, it's a simple way to make a calendar.

Download: https://drive.google.com/file/d/1BEDJLLdUajUiqh7rwwW3iUCDg1FJjOjA/view?usp=drivesdk


I use simple functions and creativity.
The loop does the opposite way of what I believe would be conventional.
When dealing with dates assembled with the year in the combobox and day and month in the listbox, the code uses the 'Me ()' operator to find the field with equal name.
Example:
The month can have up to six weeks, so for each week I have created seven fields that are the days named this way (in Portuguese):
DomSem1, SegSem1, TerSem1, QuaSem1, QuiSem1, SexSem1, SabSem1.
In English it would be:
SunWeek1, MonWeek1, TueWeek1, Wedweek1, ThuWeek1, FriWeek1, SatWeek1.


These fields are labels.


And so on to the other weeks of the month.
I use abbreviations for names not to have fields with very long names.
The functions in the loop do the following:
Code:
Day (DateSerial (Year (dtDiaPri), Month (dtDiaPri) + 1, 0)) - 1
Sets the size of the loop according to the number of days in the month.


Code:
Me (Format (dtDiaPri + j, "ddd") & "Sem"
And
Code:
DatePart ("ww", dtDiaPri + j) - DatePart ("ww", DateSerial (Year (dtDiaPri + j), Month (dtDiaPri + j), 1)) + 1) .Caption = Format d ")
Assemble the names of the labels where the days of the month will be painted. If it were today: 01/24/2018 in Portuguese it would be 'QuaSem4', in English 'WedWeek4'.

I hope it's useful.

Regards!
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Watch MrExcel Video

Forum statistics

Threads
1,122,670
Messages
5,597,483
Members
414,146
Latest member
marginmakerb

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top