How to Insert Date Picker in Excel?
In Excel, the drop-down calendar is technically known as Microsoft Date and Time Picker Control. It is inserted with the help of ActiveX Control and is not available for the 64-bit version of MS Excel.
Table of contents
- How to Insert Date Picker in Excel?
- Example 1 –The Date Picker Insertion
- Example 2 –The Code Explanation
- Example 3 – The Date Picker Operation
- Frequently Asked Questions
- Recommended Articles
- The drop-down calendar is technically known as Microsoft Date and Time Picker Control in Excel.
- The Microsoft date picker does not work on the 64-bit version of Excel.
- The drop-down calendar is inserted with the help of ActiveX Controls in the Controls group of the Developer tab.
- The Microsoft Date and Time Picker Control 6.0 (SP6) is selected in the “more controls” box to insert the drop-down calendar.
- The file should be saved with the extension “.xlsm” (macro-enabledTo enable macros simply means to run or execute a macro in a particular file in order to save the time spent on repetitive actions. To enable macros, select “enable all macros” from the “trust center” of the File tab (in the “options” button).
read more) to run the VBA code. - In the drop-down calendar, the date, month, and year can be changed with the help of the various arrow buttons.
You can download this Date Picker Excel Template here – Date Picker Excel Template
Example 1 –The Date Picker Insertion
We have the data of the employees of an organization. The different fields are–”employee code,” “employee name,” “employee joining date,” and “employee department.”
The Excel data is in the following format. We need a drop-down calendarThe calendar drop-down in Excel is an effective way of ensuring correct data entry and records, and it can be created with the data validation option to ensure error-free use.read more to enter the joining date of the employee.
A drop-down calendar makes it easy for the user to enter the joining dates. For this, we insert an ActiveX Control named “Microsoft Date and Time Picker Control 6.0 (SP6).”
The steps to create a drop-down calendar are listed as follows (the first three steps make the Developer tab visible):
- Step 1: Under the “file” menu, choose “options.”
- Step 2: A dialog box named “excel options” opens. In the option “customize ribbon” (on the left edge of the dialog box), click on the checkbox for the “developer” tab. Click “Ok.”
- Step 3: The Developer tab appears at the end of the Excel ribbon.
- Step 4: In the Insert tab (under the Controls group), choose “more controls” from ActiveX Controls.
- Step 5: Choose “Microsoft Date and Time Picker Control 6.0 (SP6)” from the list and click “Ok.”
- Step 6: Click anywhere on the worksheet to create the drop-down calendar.
- Step 7: Right-click on the date picker and choose “properties” from the list.
- Step 8: In the “CheckBox” property, change the value from “false” to “true.” This allows the null values to be accepted. Close the “properties” dialog box.
- Step 9: Right-click on the date picker and choose “view code” from the contextual menu.
Step 10: In Visual Basic Editor, a code is already written. Replace this existing code with the following code.
Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Sheet1.DTPicker1 .Height = 20 .Width = 20 If Not Intersect(Target, Range("C:C")) Is Nothing Then .Visible = True .Top = Target.Top .Left = Target.Offset(0, 1).Left .LinkedCell = Target.Address Else .Visible = False End If End With End Sub
Example 2 –The Code Explanation
The explanation followed by the code within a block is given as follows:
#1 – The first statement tells the Excel compiler to run the code whenever a new cell is selected (i.e., the selection is changed). The selected cell is sent to the sub procedure as “target.”
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
#2 – The next statement sets the height and the width of the date picker to 20 points in Excel.
Note: We use the “with” operator so that we do not refer to “DTPicker1” again and again.
With Sheet1.DTPicker1
.Height = 20
.Width = 20
#3 – The “If” clause sets the following criteria:
If any cell is selected in column C, only then does the date picker become visible. The “Intersect” function returns the address if a cell is selected in column C; otherwise, the value is null.
If Not Intersect(Target, Range("C:C")) Is Nothing Then .Visible = True
#4 – The “top” property of the date picker is equal to the “top” property value of the selected cell. This means that it goes along with the upper border of the selected cell.
.Top = Target.Top
#5 – The next statement sets the “left” property of the date picker equal to that of the next right cell (of the selected cell). This is the distance of the left border (of column D) from the extreme left of the worksheet.
Note: To get the reference of the next right cell, we use the “OffsetThe OFFSET function in excel returns the value of a cell or a range (of adjacent cells) which is a particular number of rows and columns from the reference point. read more” function with “0” as the row argument and “1” as the column argument. This gets a reference to the cell in the next column.
.Left = Target.Offset(0, 1).Left
#6 – This statement links the date picker with the target cell. It allows the value selected in the drop-down calendar to be displayed in the cell.
.LinkedCell = Target.Address
#7 – The “else” statement tells the compiler not to display the date picker when a cell other than that in column C is selected.
Else .Visible = False
#8 – At the end, we close the “If” statement.
End If
#9 – We also close the “with” statement.
End With
#10 – Now, the sub procedure ends.
End Sub
Note: The file should be saved with the extension “.xlsm.” This allows the VBA codeVBA code refers to a set of instructions written by the user in the Visual Basic Applications programming language on a Visual Basic Editor (VBE) to perform a specific task.read more to run when any cell is selected in column C.
Example 3 – The Date Picker Operation
With the selection of a cell in column C, the drop-down calendar appears at the top right corner of the selected cell.
The working of the drop-down calendar is explained as follows:
- The drop-down calendar can be opened by clicking the down arrow.
- To enter a date in the selected cell, click on that date from the calendar of the required month.
- To go to the previous or the next month, click the arrow buttons placed at the left and the right side of the calendar.
- The month can be chosen from the drop-down calendar by clicking on it.
- The required year can be chosen and changed by clicking the up and down arrow buttons.
Frequently Asked Questions
How to customize the Excel date picker?
The steps to customize the date picker are listed as follows:
1. Select the calendar control and put on the “design mode.” Alternatively, drag a corner of the date picker (design mode on) to resize it.
2. In the “properties” window, set the desired height, width, and font.
3. Drag the control when the cursor changes to a four-point arrow. This moves the date picker to the preferred location.
4. Select the date picker and on the Format menu, make changes to “borders and shading.” This changes the border and the color of the date picker.
When is the Excel date picker used?
The date picker is used in the following situations:
– To display the billing and shipping dates of customer orders
– To show the departure dates of flights on travel request forms
– To show the joining date of employees in the Excel database of an organization
– To display the date of birth on insurance forms
How to select a date range in the Excel date picker?
For selecting the date range, the user has to select the start and the end date of a process. In such cases, the date picker displays two input boxes adjacent to each other.
The date picker control assists the user to insert “to” and “from” dates on a form template. Such range selection in the calendar is often used in flight applications. With the selection of the two dates, the date range is highlighted in the calendar.
Recommended Articles
This has been a guide to the Excel date picker. Here we discuss how to insert the date picker in Excel along with practical examples and a downloadable Excel template. You may learn more about Excel from the following articles –
- MAXIFS Function in ExcelExcel MAXIFS is a function that provides the maximum value in a data set range based on certain criteria or set of conditions like date, number, text, etc. The syntax used in this function is =MAXIFS(max_range, criteria_range1, criteria1, …).read more
- PERCENTRANK Function in ExcelThe PERCENTRANK function gives the rank to each number against overall numbers in percentage numbers.read more
- Calendar Excel TemplateCalendar Template in Excel offers a pre-designed structure of a calendar that can be customized according to one’s needs. Excel calendar can be used for school curriculums, desk calendars etc.read more
- Insert Calendar In ExcelA valuable function in Excel is the ability to insert a calendar. A calendar can be populated with any text, memo, or note. When manually entering data, this saves time.read more
Do you need a DatePicker Calendar in your Excel spreadsheets? Follow this quick and simple tutorial to find out how. (If you prefer video, scroll down to the bottom of the page!)
Step 1. Enable Developer Mode in Excel
- File
- Options
- Customize Ribbon
- Ensure Developer checkbox is enabled
[sibwp_form id=100]
Step 2. Setup DateTime Control box
- Microsoft Date and Time Picker Control
- Click on random cell to place control box
- Edit or remember the name box of the DateTime Picker, in this case, we will leave it as DatePicker1
- Right click on DateTime Control box
- DTPicker Object
- Properties
- Enable CheckBox
Step 3. Copy the Visual Basic code
To assign column A as a DatePicker, copy the following code:
Code language: PHP (php)
Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Sheet1.DTPicker1 .Height = 20 .Width = 20 If Not Intersect(Target, Range("A:A")) Is Nothing Then .Visible = True .Top = Target.Top .Left = Target.Offset(0, 1).Left .LinkedCell = Target.Address Else .Visible = False End If End With End Sub
- Right click the DateTime Control box
- View Code
- Replace all of the existing code with the code from above
- Close the Visual Basic editor
- Deselect Design Mode
- Click on any cell to remove DateTime Control box
- Click on any cell in Column A to add a Date
Congratulations!
Important: Make sure that when you save the spreadsheet, you “Save As: Macro enabled workbook”
How to have multiple columns with DatePickers
The above steps only work for single columns, or columns that are right next to each other. If you wanted the DatePicker column to be in column B instead, then you would change the line
Code language: JavaScript (javascript)
If Not Intersect(Target, Range("A:A")) Is Nothing Then
to
Code language: JavaScript (javascript)
If Not Intersect(Target, Range("B:B")) Is Nothing Then
Or if you wanted it from Column E to Column G, then you would change that line to
If Not Intersect(Target, Range("E:G")) Is Nothing Then
Code language: JavaScript (javascript)
However, if you need a DatePicker in two or more non-adjacent columns, then you will need a separate DatePicker (each with a separate name in the Name Box) for each non-adjacenet group. For example, let’s say we need column A, B, E, F, and H to all be DatePickers. We would need to perform the above steps 3 separate times for 3 separate DatePickers.
- 1 for columns A, B
- 1 for columns E, F
- 1 for column H
The steps will be very similar, but the code will be:
Code language: PHP (php)
Private Sub Worksheet_SelectionChange(ByVal Target As Range) With Sheet1.DTPicker1 .Height = 20 .Width = 20 If Not Intersect(Target, Range("A:B")) Is Nothing Then .Visible = True .Top = Target.Top .Left = Target.Offset(0, 1).Left .LinkedCell = Target.Address Else .Visible = False End If End With With Sheet1.DTPicker2 .Height = 20 .Width = 20 If Not Intersect(Target, Range("E:F")) Is Nothing Then .Visible = True .Top = Target.Top .Left = Target.Offset(0, 1).Left .LinkedCell = Target.Address Else .Visible = False End If End With With Sheet1.DTPicker3 .Height = 20 .Width = 20 If Not Intersect(Target, Range("H:H")) Is Nothing Then .Visible = True .Top = Target.Top .Left = Target.Offset(0, 1).Left .LinkedCell = Target.Address Else .Visible = False End If End With End Sub
Important legal notice: This post contains affiliate links. We are compensated for many of our product recommendations. Pragmatic Ways is a participant in the Amazon Associates affiliate program, as well as other affiliate programs. While we are always careful to only recommend the products we use and recommend, we want to be open and transparent about our relationship with companies we recommend.
Adam Allard
Hi, I’m Adam Allard. I’m a Full Stack Software Engineer for Northrop Grumman creating web applications for the DoD. At this time I’m primarily working with Java and Angular based applications, although I have some years of experience in various languages and frameworks from previous jobs where I dabbled with Python & Django, C# & Xamarin, PHP, and Bootstrap. My hobbies include time with my family, wondering when the Green Bay Packers will win their next Super Bowl, drinking over-priced beer, and of course learning and teaching.
Recent Posts
Unit Conversions
The tables below are all the unit conversion factors used in the Unit Converter App tutorial, where we walked through together building out a JavaFX and SceneBuilder interface.
Click here to…
How to add JavaFX to Eclipse (the easy way)
Step 1. Download JavaFX
Go to https://gluonhq.com/products/javafx/ and download the appropriate SDK for your operating system. Make sure you download the SDK and make sure you choose the correct…
In the tutorial I am going to show you how to include a date-picker in your Excel worksheet. The tutorial includes two ways of achieving this.
Click here to download the featured file.
The first method uses Sam Radakovitz’s Date Picker add-in which is compatible with all versions of Excel. Sam is a Microsoft employee and lead on Excel. The second method uses the Mini Calendar and Date Picker by Vertex 42 which is found in the Microsoft store. Both add-ins are free to use.
METHOD 1: Sam Radakovitz’s Date Picker Add-In
This part of the video tutorial starts here: https://youtu.be/i3YDAuUVoes?t=74
To use Sam’s add-in you need to:
- Head over to his website page http://samradapps.com/datepicker
- Scroll down the webpage until you see the link to download the date-picker add-in. This will download a zip folder
- Open the zip folder and copy the Excel add-in
- Sam’s website gives some suggestion as to how and where to install the add-in, alternatively you can create a folder in the root of your C: drive – name the folder something like Excel Startup Folder
- Paste the add-in into this folder
- In File Explorer copy the path of the folder you have just created
- In Excel, select the ribbon’s File tab and then select Options (bottom left)
- In the Excel Options dialog select Advanced
- Under General (scroll almost to the bottom to see this), paste the folder’s path into the box labelled At Startup, open files in:
- Click on OK to confirm
- Close down Excel and re-open
- Create a blank workbook or open an existing file and you should see a Date Picker button appear on the ribbon
If the Date Picker button disappears when you next use Excel, you need to change the permissions for the add-in. To change the permissions, follow these steps:
This part of the video tutorial starts here: https://youtu.be/i3YDAuUVoes?t=182
- In File Explorer navigate to the folder you created
- Right-click on the add-in and select Properties in the menu
- On the General tab in the Security section, tick Unblock
- Click on OK to confirm
- Close and reopen Excel and you should find the Date Picker button has reappeared on Excel’s ribbon
How Does Sam’s Date Picker Work?
This part of the video tutorial starts here: https://youtu.be/i3YDAuUVoes?t=216
To use the date picker to enter dates in a cell or column:
- Click in a cell where you want to enter a date
- Click on the Date Picker button and select a date
- Once the date picker has been used in one cell, the rest of the cells in that column will display a Date Picker button when selected
- You can also right-click in a cell and select Date Picker at the top of the menu
- You also insert the date and time from the Date Picker button
5 FREE EXCEL TEMPLATES
Plus Get 30% off any Purchase in the Simple Sheets Catalogue!
Method 2: Mini Calendar and Date Picker by Vertex 42 Add-in
This part of the video tutorial starts here: https://youtu.be/i3YDAuUVoes?t=328
To use the Mini Calendar and Date Picker by Vertex 42, follow these steps:
- Display the Developer tab on Excel’s ribbon by right-clicking on an existing tab and selecting Customise the Ribbon.
- In the Excel Options dialog tick Developer (bottom-right)
- Click OK to confirm
- On the Developer tab, click the Add-ins button
- In the Office Add-ins screen, select STORE
- In the Search box type datepicker
- Next to Mini Calendar and Date Picker click on the Add button
- Click Continue
There a various customisation options for this add-in which I discuss at this point in the video https://youtu.be/i3YDAuUVoes?t=363
This next of the video tutorial starts here: https://youtu.be/i3YDAuUVoes?t=392
This date-picker is a floating object and so might get in the way. I decided to place the data picker in an empty row above my data. You can obviously resize the row and data picker so it fits. You can then freeze that row so the date picker is always visible. To freeze rows:
- Click in the left-most cell of the row beneath the row or rows you want to freeze
- Select the View tab on Excel’s ribbon
- Click Freeze Panes | Freeze Panes
How Does the Mini Calendar and Date Picker by Vertex 42 Add-in Work?
This part of the video tutorial starts here: https://youtu.be/i3YDAuUVoes?t=415
To use the Mini Calendar and Date Picker by Vertex 42 Add-in, follow these steps:
- Click in the cell where you want the date or time to appear
- Select a date from the date picker or click on the time button to enter the current time
This add-in allows you to add date and time separately which Sam’s add-in does not allow you to do.
The next part of the video tutorial starts here: https://youtu.be/i3YDAuUVoes?t=477
To use the date picker on another worksheet, follow these steps:
- Select the worksheet
- On the Developer tab, click the Add-ins button
- In the Office Add-ins screen select the Mini Calendar and Date Picker add-in
- Click on Add (bottom-right)
- The date picker will appear in the worksheet
Vertex42 had created some useful Excel templates and add-ins – click here to see their offerings.
Shortcut Keys for Entering the Current Date and Time
These shortcut keys will work with or without these date-picker add-ins installed.
CTRL ; (current date)
CTRL SHIFT ; (current time)
Всплывающий календарь
Если вам часто приходится вводить даты в ячейки листа, то делать это вручную неудобно. Для ввода именно сегодняшней даты можно воспользоваться функцией СЕГОДНЯ (TODAY), сочетанием клавиш Ctrl+; или макросом, но если нужны разные даты из прошлого или будущего, то вбивать их руками долго.
К сожалению, в стандартном арсенале средств Excel нет встроенного выпадающего календаря (в отличие от Word), да еще и в последних версиях, начиная с Excel 2007, Microsoft зачем-то убрала из стандартного комплекта поставки библиотеку mscalc.osx, которая позволяла быстро создать пользовательскую форму с календарем.
Естественно, это «узкое место» не осталось без внимания опытных пользователей и экспертов Excel MVP, которые оперативно создали несколько интерактивных календарей на макросах для удобного ввода дат. Вот подборка неплохих, на мой взгляд, бесплатных вариантов:
Windows Date Picker Автор: Ron de Bruin Цена: бесплатно Ссылка
|
|
Excel Date Picker Автор: Jim Cone Цена: бесплатно Ссылка
|
|
Mini Calendar and Date Picker Автор: VERTEX Цена: бесплатно. Ссылка в Office Apps Store
|
|
Date Picker Автор: Sam Radakovitz, руководитель команды программистов Excel в Microsoft Цена: бесплатно Сайт автора умер, ссылки не работают, но можно скачать заботливо сохраненную мной когда-то копию здесь.
|
P.S.
Установка надстроек:
- в Excel 2003 и старше — меню Сервис — Надстройки — Обзор (Tools — Add-ins — Browse)
- в Excel 2007 и новее — Файл — Параметры — Надстройки — Перейти — Обзор (File — Options — Add-ins — Go To — Browse)
Ссылки по теме
- Всплывающий календарь из надстройки PLEX
- Автоматический ввод даты при изменении ячейки
A calendar in Microsoft Excel comes in handy if you’ve a busy schedule. Although an Excel calendar is an outstanding tool that can assist you to stay prepared when it comes to vital events, appointments, activities, meetings, etc. Therefore, today we are here to discuss how to create calendar in Excel or how to insert calendar in Excel effortlessly.
So, without any further ado, let’s get started…
To repair corrupt Excel file, we recommend this tool:
This software will prevent Excel workbook data such as BI data, financial reports & other analytical information from corruption and data loss. With this software you can rebuild corrupt Excel files and restore every single visual representation & dataset to its original, intact state in 3 easy steps:
- Download Excel File Repair Tool rated Excellent by Softpedia, Softonic & CNET.
- Select the corrupt Excel file (XLS, XLSX) & click Repair to initiate the repair process.
- Preview the repaired files and click Save File to save the files at desired location.
If you want to keep your data in a more organized way then a proper calendar system is very important for the right time management. Luckily Excel offers different ways to create calendars. Let’s know about each of them one by one in detail.
Method 1: Insert Calendar In Excel Using Date Picker Control
Well putting the drop-down calendar in Excel is quite easy to do but just because the time and date picker control are hidden so many users don’t know where it actually exists.
Here is the complete method to create a calendar in Excel perform this task step by step:
Note: Date Picker control of Microsoft works Microsoft’s very smoothly in the Excel 32-bit versions but not in Excel 64-bit version.
- Enable The Developer Tab on Excel ribbon.
Excel date picker control actually belongs to the ActiveX controls family, which comes under the Developer tab. Though this Excel Developer tab is kept hidden you can enable its visibility.
- On the Excel ribbon, you have to make a right-click, and after that choose the option Customize the Ribbon…. This will open the Excel options.
- From the opened window go to the right-hand side section. Now from customizing the ribbon section, you have to select the Main Tabs. In the appearing main tab list check the Developer box option and then click the OK button.
Also Read: How to Create a Flowchart in Excel? (Step-By-Step Guide)
- Insert The Calendar Control
Well, the Excel drop-down calendar is technically known as Microsoft Date and Time Picker Control.
To apply this in the Excel sheet, perform the following steps:
- Hit the Developer tab and then from the Controls group, you have to make a tap over arrow sign present within the Insert tab.
Now from the ActiveX Controls choose the “More Controls” button.
- From the opened dialog box of More Controlsselect the Microsoft Date and Time Picker Control 6.0 (SP6). After that click to the OK
- Hit the cell, in which you have to enter the calendar control.
You will see that a drop-down calendar control starts appearing on your Excel sheet:
Once this date picker control is been inserted, you will see that the EMBED formula starts appearing within the formula bar.
This gives detail to your Excel application about what kind of control is embedded within the sheet. You can’t change edit or delete this control because this will show the error “Reference is not valid“.
Adding the ActiveX control such date picker automatically enables the design mode which will allow you to change the properties and appearance of any freshly added control. The most obvious modification that you need to make at this time is resizing the calendar control and then linking it back to any specific cell.
For activating the Excel drop-down calendar option, hit the Design tab, and then from the Controls group, disable the Design Mode:
- Now, make a tap over the drop-down arrow for showing up the calendar and then select the date as per your need.
- Click the dropdown arrow to show the calendar in Excel and choose your desired date.
Note:
If MS date picker control is now not available within the list of More Controls. This situation mainly arises due to the following reasons.
- While you are running the MS Office 64 bit version. As there is no official date picker control available in the Office 64-bit.
- Calendar control i.e mscomct2.ocx is now not present or it is not registered on your PC.
- Customize Calendar Control
After the addition of the calendar control on your Excel sheet, now you have to shift this calendar control on the desired location and then resize it to get an easy fit within a cell.
- For resizing this date picker control, you have to enable the Design Mode after that drag this control from the corner section:
Or else you after enabling the Design Mode on, from the calendar control group choose the Properties tab:
- From the opened Properties window, you have to set the desired width, height, font size and style:
- To shift the Excel date picker control, place your mouse pointer over that and when the cursor changes into a four-pointed arrow sign, just drag the object wherever you want to place it.
- Link Excel Calendar Control With The Cell
After successfully adding the calendar drop-down in excel, you need to link it with some specific cell. This step very compulsory to perform if you want to make use of any selected dates with the formulas.
Suppose you are writing the formula for counting up the order’s number between any specific dates. For stopping any other from entering wrong dates such as 2/30/2016 you have inserted a drop-down calendar within 2 cells.
The COUNTIF formula that you have applied for calculating a number of orders will return the value “0” even if the orders are present.
Well, the main reason can be that your Excel is unable to recognize the value present in the date picker control. This problem will persist until you link the control with some specific cell. Here is the step that you need to perform:
- Selecting the calendar control you have to enable the Design Mode.
- Go to the Developer tab and then from the control group tap to the
- In the opened “Properties” windows, assign cell reference in the LinkedCell property (here I have written A3):
If Excel shows the following error “Can’t set cell value to NULL…” then click the OK button to ignore this.
After selecting the date from the drop-down calendar, the date will immediately start appearing in the linked cell. Now excel won’t face any issue in understanding the dates and the formula referencing done in the linked cells will work smoothly.
If you don’t need to have extra dates then link the date picker control with the cells where they are present.
Also Read: 4 Ways To Create Drop-Down List In Excel
Method 2: Using Excel Calendar Template
In Excel, there are handy graphic options with the clipart, tables, drawing tools, charts, etc. Using these options one can easily create a monthly calender or weekly calendar with special occasion dates or photos.
So go with the Excel calendar template which is the fastest and easiest way to create calendar in Excel using worksheet data.
Here are the steps to create calendar from Excel spreadsheet data using the template.
- Click the File> New after that in the search box you have to type “calendar”.
- Excel will make search thousands of online templates and then shows you the selected calendar templates which are grouped into the following categories.
- Choose the calendar template as per your requirement, and then tap to the Create.
That’s all you need to do…!
Excel calendar template will be opened from the new Excel workbook and then print or customize as per your need. Usually, Excel weekly calendar templates are set with a year, whereas in some templates you can set a day for starting a week.
Note: for displaying always the current year in your excel calendar just assign a simple formula like this in the cell of the year: =YEAR(TODAY())
In this way, you can easily insert the drop-down calendar. Also, you can make a printable Excel calendar.
Method 3: Create Calendar In Excel Using VBA Code
In this method, you will get know-how using the Visual Basic for Applications(VBA) macro code you can create calendar in Excel.
- Open your Excel workbook.
- For excel 2003 users: Go to the Tools menu, and then hit the Macro tab. After that choose the Visual Basic Editor.
For Excel 2007 or later users: go to the Developer tab from the Excel ribbon and choose Visual Basic.
- From the Insert menu, choose the Module option.
- Now paste the VBA code which is given below into the opened sheet of the module.
- Go to the File menu and choose the Close and Return to Microsoft Excel.
- Now make a selection of the Sheet1
- From the Tools menu, go to the Macro tab. After that choose the Macros icon.
- Now you have to choose the CalendarMaker Now press the Run button to create Excel calendar.
Visual Basic Procedure To Create a Calendar In Excel:
You have to paste this code in the module sheet.
Sub CalendarMaker()
‘ Unprotect sheet if had previous calendar to prevent error.
ActiveSheet.Protect DrawingObjects:=False, Contents:=False, _
Scenarios:=False
‘ Prevent screen flashing while drawing calendar.
Application.ScreenUpdating = False
‘ Set up error trapping.
On Error GoTo MyErrorTrap
‘ Clear area a1:g14 including any previous calendar.
Range(“a1:g14”).Clear
‘ Use InputBox to get desired month and year and set variable
‘ MyInput.
MyInput = InputBox(“Type in Month and year for Calendar “)
‘ Allow user to end macro with Cancel in InputBox.
If MyInput = “” Then Exit Sub
‘ Get the date value of the beginning of inputted month.
StartDay = DateValue(MyInput)
‘ Check if valid date but not the first of the month
‘ — if so, reset StartDay to first day of month.
If Day(StartDay) <> 1 Then
StartDay = DateValue(Month(StartDay) & “/1/” & _
Year(StartDay))
End If
‘ Prepare cell for Month and Year as fully spelled out.
Range(“a1”).NumberFormat = “mmmm yyyy”
‘ Center the Month and Year label across a1:g1 with appropriate
‘ size, height and bolding.
With Range(“a1:g1”)
.HorizontalAlignment = xlCenterAcrossSelection
.VerticalAlignment = xlCenter
.Font.Size = 18
.Font.Bold = True
.RowHeight = 35
End With
‘ Prepare a2:g2 for day of week labels with centering, size,
‘ height and bolding.
With Range(“a2:g2”)
.ColumnWidth = 11
.VerticalAlignment = xlCenter
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = xlHorizontal
.Font.Size = 12
.Font.Bold = True
.RowHeight = 20
End With
‘ Put days of week in a2:g2.
Range(“a2”) = “Sunday”
Range(“b2”) = “Monday”
Range(“c2”) = “Tuesday”
Range(“d2”) = “Wednesday”
Range(“e2”) = “Thursday”
Range(“f2”) = “Friday”
Range(“g2”) = “Saturday”
‘ Prepare a3:g7 for dates with left/top alignment, size, height
‘ and bolding.
With Range(“a3:g8”)
.HorizontalAlignment = xlRight
.VerticalAlignment = xlTop
.Font.Size = 18
.Font.Bold = True
.RowHeight = 21
End With
‘ Put inputted month and year fully spelling out into “a1”.
Range(“a1”).Value = Application.Text(MyInput, “mmmm yyyy”)
‘ Set variable and get which day of the week the month starts.
DayofWeek = WeekDay(StartDay)
‘ Set variables to identify the year and month as separate
‘ variables.
CurYear = Year(StartDay)
CurMonth = Month(StartDay)
‘ Set variable and calculate the first day of the next month.
FinalDay = DateSerial(CurYear, CurMonth + 1, 1)
‘ Place a “1” in cell position of the first day of the chosen
‘ month based on DayofWeek.
Select Case DayofWeek
Case 1
Range(“a3”).Value = 1
Case 2
Range(“b3”).Value = 1
Case 3
Range(“c3”).Value = 1
Case 4
Range(“d3”).Value = 1
Case 5
Range(“e3”).Value = 1
Case 6
Range(“f3”).Value = 1
Case 7
Range(“g3”).Value = 1
End Select
‘ Loop through range a3:g8 incrementing each cell after the “1”
‘ cell.
For Each cell In Range(“a3:g8”)
RowCell = cell.Row
ColCell = cell.Column
‘ Do if “1” is in first column.
If cell.Column = 1 And cell.Row = 3 Then
‘ Do if current cell is not in 1st column.
ElseIf cell.Column <> 1 Then
If cell.Offset(0, -1).Value >= 1 Then
cell.Value = cell.Offset(0, -1).Value + 1
‘ Stop when the last day of the month has been
‘ entered.
If cell.Value > (FinalDay – StartDay) Then
cell.Value = “”
‘ Exit loop when calendar has correct number of
‘ days shown.
Exit For
End If
End If
‘ Do only if current cell is not in Row 3 and is in Column 1.
ElseIf cell.Row > 3 And cell.Column = 1 Then
cell.Value = cell.Offset(-1, 6).Value + 1
‘ Stop when the last day of the month has been entered.
If cell.Value > (FinalDay – StartDay) Then
cell.Value = “”
‘ Exit loop when calendar has correct number of days
‘ shown.
Exit For
End If
End If
Next
‘ Create Entry cells, format them centered, wrap text, and border
‘ around days.
For x = 0 To 5
Range(“A4”).Offset(x * 2, 0).EntireRow.Insert
With Range(“A4:G4”).Offset(x * 2, 0)
.RowHeight = 65
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
.WrapText = True
.Font.Size = 10
.Font.Bold = False
‘ Unlock these cells to be able to enter text later after
‘ sheet is protected.
.Locked = False
End With
‘ Put border around the block of dates.
With Range(“A3”).Offset(x * 2, 0).Resize(2, _
7).Borders(xlLeft)
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Range(“A3”).Offset(x * 2, 0).Resize(2, _
7).Borders(xlRight)
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
Range(“A3”).Offset(x * 2, 0).Resize(2, 7).BorderAround _
Weight:=xlThick, ColorIndex:=xlAutomatic
Next
If Range(“A13”).Value = “” Then Range(“A13”).Offset(0, 0) _
.Resize(2, 8).EntireRow.Delete
‘ Turn off gridlines.
ActiveWindow.DisplayGridlines = False
‘ Protect sheet to prevent overwriting the dates.
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, _
Scenarios:=True
‘ Resize window to show all of calendar (may have to be adjusted
‘ for video configuration).
ActiveWindow.WindowState = xlMaximized
ActiveWindow.ScrollRow = 1
‘ Allow screen to redraw with calendar showing.
Application.ScreenUpdating = True
‘ Prevent going to error trap unless error found by exiting Sub
‘ here.
Exit Sub
‘ Error causes msgbox to indicate the problem, provides new input box,
‘ and resumes at the line that caused the error.
MyErrorTrap:
MsgBox “You may not have entered your Month and Year correctly.” _
& Chr(13) & “Spell the Month correctly” _
& ” (or use 3 letter abbreviation)” _
& Chr(13) & “and 4 digits for the Year”
MyInput = InputBox(“Type in Month and year for Calendar”)
If MyInput = “” Then Exit Sub
Resume
End Sub
Note: You can customize the above code as per your requirement.
How Do I Make Excel Calendar Update Automatically?
Automatization is the chief strength of Microsoft Excel. However, if you need to create your calendar update automatically then use the formula mentioned below:
“= EOMONTH (TODAY() , – 1) +1”.
Well, the above formula employs “TODAY” feature to locate the present date & calculates the 1st day of the month with the “EOMONTH” feature.
Related FAQs:
Does Excel Have a Calendar Template?
Yes, of course, Microsoft Excel have a wide variety of calendar templates that can be used easily.
What Is the Formula to Create a Calendar in Excel?
=DATE(A2,A1,1) is the formula that can be used to create a calendar in MS Excel. All you need to do is to select the blank cell for showing the starting month’s date, then simply enter =DATE(A2,A1,1) in a formula bar >> press Enter key.
Can You Insert a Calendar into An Excel Cell?
YES, you can insert a calendar into an Excel cell. For this, you have to go to File menu >> select Close & Return to MS Excel. After this, select a tab ‘Sheet1’. On Tools menu, simply point to the Macro, & select Macros. choose CalendarMaker >> select the Run to create a calendar.
Also Read: How To Create Backup Of Active Workbooks In Excel?
Wrap Up:
MS Excel offers its user a broad range of tools which will increase their productivity by using the projects, dates, and tracking events. In order to view the data of your Excel worksheet in calendar format, Microsoft will change your data and then import it into the Outlook. This will automatically change it into a calendar format.
Hopefully, you must have found an ample amount of information in this post. Thanks for reading this post….!
Priyanka is an entrepreneur & content marketing expert. She writes tech blogs and has expertise in MS Office, Excel, and other tech subjects. Her distinctive art of presenting tech information in the easy-to-understand language is very impressive. When not writing, she loves unplanned travels.
Excel is a Microsoft spreadsheet application that packs in many features. Many of its users set up sheets that include date cells or columns. Most users usually manually enter dates into Excel spreadsheet cells. A date picker tool with which users can simply select dates from a small calendar drop-down menu to enter them in cells would certainly be a handy Excel feature. Yet, Excel’s Ribbon tabs lack such a feature.
No matter where you look on Excel’s Ribbon tabs, you won’t find a date picker utility. The Insert or Home tabs in Excel would be the most obvious places for Microsoft to incorporate a date picker button. Then users could select a cell to add a date to and click the date picker button on a tab to open a drop-down calendar. Alas, the big M has yet to dream up such a wonderful feature for Excel. Come on, Microsoft, you can do better!
However, that doesn’t mean there’s no way you can utilize a date picker in Excel. There are plenty of add-ins for Excel that add additional features to that application. Some of those add-ins add date picker calendars to Microsoft’s flagship application. If you dig beneath the surface of Excel a bit, you’ll also discover that its developer tools enable uses to insert drop-down calendars into sheets.
So, maybe you should add a date picker to Excel if you often need to enter dates into your spreadsheets’ cells. Such a tool would save you tediously manually entering dates into cells. This is how to add date pickers in Excel with three different methods.
Without add-ins, you’ll have to utilize Excel’s Developer tab to insert date pickers in sheets. As the Developer tab isn’t a default one in Excel, you’ll need to do some Ribbon customization for this method. The Developer tab includes ActiveX controls you can select and add to sheets. The Microsoft Date and Time Picker Control 6.0 (SP6) control enables you to insert a drop-down calendar in Excel sheets. This is how to insert a calendar in Excel with Microsoft Date and Time Picker Control 6.0 (SP6).
Step 1: Open a spreadsheet you want to insert a date picker in within Excel.
Step 2: Click Excel’s File tab.
Step 3: Select “Options” on the left side of the tab to open the Excel Options window.
Step 4: Click Customize Ribbon on the left of the window.
Step 5: Select the unchecked “Developer” checkbox.
Step 6: Click the “OK” button.
Step 7: Next, select the Developer tab.
Step 8: Click the “Insert” button on that tab.
Step 9: Then click the “More Controls” button on the ActiveX Controls options.
Step 10: Select Microsoft Date and Time Picker Control 6.0 in the More Controls window shown directly below.
Step 11: Press the “OK” button to confirm.
Step 12: Click anywhere within your spreadsheet to place the calendar drop-down control. Then drag it into an appropriate position on the sheet and resize its box as required.
Step 13: Right-click the inserted calendar drop-down control and select “Properties” on the context menu.
Step 14: Enter a cell reference you want to link the drop-down calendar within the LinkedCell box on the Properties window.
Step 15: Thereafter, close the Properties window. If an error message dialog box pops up after closing Properties, click the “OK” option on that window.
Step 16: Finally, turn off Design Mode by selecting the Developer tab and clicking the “Design Mode” button there.
Thereafter, you can click the date picker drop-down control to select a date on it. It will enter the selected date in the cell you linked to. Thus, this date picker only applies to the one cell it’s linked to.
Also, note that this method for inserting a drop-down calendar in Excel does not apply to 64-bit versions of Excel. This method works for 32-bit versions of Excel 2010, 2013, and 2016. Thus, Excel 2019 users have no choice but to add date picker add-ins (extensions) to that application as outlined for the methods below.
The Easiest Way to Insert Drop Down Calendar (Date Picker) in Excel
Kutools for Excel is a general Excel add-in that adds a whole new tab to that application, which includes numerous handy tools and options. With that add-in installed, you can select an “Enable Date Picker” option that activates a calendar date picker tool. Kutools for Excel also comes with a handy Insert Date feature to boot. This is how to add a Data Picker in Excel with the Kutools add-in.
Step 1: When you’ve installed and enabled the Kutools for Excel add-in, select the Kutools tab.
Step 2: Click the “Content” button on the Kutools tab.
Step 3: Select the “Enable Date Picker” option on the menu.
Step 4: Next, select a date cell in your spreadsheet. Then click the small calendar icon that appears by the cell to open the Date Picker calendar shown directly below.
Step 5: Choose a date on the calendar to input within the selected cell.
KuTools for Excel’s Insert Date tool is handy for inputting dates within blank cells. To utilize that tool, select a cell and click “Insert” on the Kutools tab. Select the “Insert Date” option. Then you can choose a date and format to insert within the chosen cell.
Check Out the Free Excel Date Picker Add-in
Alternatively, you can add the freely available Excel Date Picker add-in to Microsoft’s spreadsheet application. Unlike Kutools for Excel, Excel Date Picker adds just one new feature (a date picker calendar) to the software. If you don’t need any of the extra bells and whistles that come with Kutools for Excel, this add-in might be a better option. You can insert a date picker in Excel with that add-in as follows.
Step 1: Click the “Download now” link on the Excel Date Picker webpage.
Step 2: Open the folder you downloaded the add-in’s ZIP to in File Explorer, select the Data Picker ZIP archive, and click the “Extract all” button.
Step 3: Press the “Browse” button to select a folder to extract the ZIP.
Step 4: Click the “Extract” option.
Step 5: Open Excel, click its File tab, and select “Options.”
Step 6: Next, select Add-ins on the Excel Options window.
Step 7: Click the “Manage” drop-down menu to select “Excel Add-ins,” and press the “Go” button.
Step 8: Click “Browse” on the Add-ins window, select the datepicker file in its extracted folder, and press the “OK” button.
Step 9: Now select the Samradapps_Datepicker checkbox in the Add-ins window, and click the “OK” button.
Step 10: Select Excel’s Home tab, which will now include a “Date Picker” button.
Step 11: Next, select a cell on your spreadsheet to add a date.
Step 12: Then click the “Date Picker” button on the Home tab to select a date from its drop-down calendar. You can also right-click a blank cell and select “Date Picker” to bring up the calendar selection.
FAQs About Date Picker in Excel
What Excel versions does the aforementioned Excel Date Picker add-in work with?
Excel Date Picker is compatible with all 32 and 64-bit Excel versions dating back to 2007.
Can I utilize a calendar date picker in Excel’s web app?
You can add additional add-ins to the MS Excel web app from the Office Add-ins store. The
Mini Calendar and Date Picker is an add-in available within the Office Add-ins store. You can add that add-in to the Excel web app and utilize it as follows.
Step 1: Open the Excel web app in your browser.
Step 2: Click the Insert tab in the Excel web app.
Step 3: Next, press the “Add-ins” button shown in the snapshot directly below.
Step 4: Click “Store” in the Office Add-ins window.
Step 5: Input the keyword Mini Calendar and Date Picker in the search box and hit Enter.
=
Step 6: Press the “Add” button for Mini Calendar and Date Picker.
Step 7: Click “Continue” to add the date picker to the web app as shown directly below.
Step 8: Select a cell to add a date to.
Step 9: Then click a date on the add-in’s calendar to add it to the cell.
Is there any way I can further customize an ActiveX calendar control added to my spreadsheet?
Yes, you can configure an ActiveX calendar control’s colors and font via its Properties window.
Are there any other date picker add-ins for Excel worth noting?
Ablebits Date Picker for Excel and Pop-up Excel Calendar are two other add-ins for that application. However, Ablebits Date Picker is available at a discounted $69, which is quite pricey for a single Excel add-in tool.
Conclusion
Hopefully, Microsoft will one day add a date picker feature to one of Excel’s tabs. Until that day comes, however, you’ll have to make do with the Microsoft Date and Time Picker Control 6.0 (SP6) or Excel’s date picker calendar add-ins. If you only need to incorporate a drop-down calendar for a single cell in a sheet, the first method should be sufficient. Kutools for Excel and Excel Date Picker provide two of the best tools for users who need to input dates in multiple cells.