Date picker for Excel with VBA code

preview_player
Показать описание
Download the date picker add-in and watch the video to learn how to create / customize a date picker for your needs in Excel.

00:00 👋 Intro
01:01 📅 Create the grid icon
06:35 ✏️ Create the form
09:50 🔨 Setting up the calendar
11:10 👨‍💻 Populate the calendar days
19:08 👩‍💻 Click event for calendar days
21:52 🎉 More to explore

⬇️ Download it here:

📺 Want to use a date picker in a user form?

🏫 Learn how to enable downloaded VBA code here:

💃🕺💃🕺💃🕺
Рекомендации по теме
Комментарии
Автор

I programmed in VB since 2005, and I thought I mastered it, till today, I am humbled.
More than a week now I searched over the net how to do exactly this, and the only option I found was the TDatePicker. But the problem was it appears in front of the cell!
But this, what you shared, is exactly, exactly, yet EXACTLY what I had in mind, but struggled to do it.

You are a divine messenger, and earned my subscription. You are the very first channel I registered yet I am then #147 of your subscriber. God bless my brother, waiting for the next video agani

TsiriniainaRakotonirina
Автор

Thank you for this video. I followed your tutorial and I managed to create Date Picker.

cameleonscorpion
Автор

Ive been doing VBA/Excel almost day to day for 10 years and this just proves there's still more to learn. I had a different idea but this was so elegantly and wonderfully presented I didn't see any other reason to try and homebrew my own idea. This was a wonderful tutorial and creativity for this solution was off the charts. Great stuff man.

motos
Автор

First of all thank you VERY much for an outstanding piece of code! Anyone with the 64 bit version of office will be eternally thankful for a functioning date picker.
However, there is one change to the code I would strongly suggest you implement in your version. The datepicker shows up whenever a cell is formatted as a date. If you reference a date via a formula someone might inadvertantly overwrite the formula with the date picker. A simple fix is to test for a formula in a cell and if so NOT display the datepicker.
it can easily be fixed in the Class Module - DatePicker Manager in the function checkForGridDP:
replace the line If VBA.IsDate(ActiveCell) Or ActiveCell.NumberFormat Like "*[Dd]*" Then
with: If (VBA.IsDate(ActiveCell) Or ActiveCell.NumberFormat Like "*[Dd]*") And Not (ActiveCell.HasFormula) Then
This will fix this issue.
There is one more thing which would be a major enhancement. The original ActiveX datepicker allowed for a specific cell to be referenced. So DatePickers on different sheets could change the same "global" date cell which was really helpful. This is impossible to achieve with the current implementation. The DatePicker form would have to include a field where the reference cell could be entered. When left emptpy, the date would be applied to the selected cell as it works right now.

Just some thoughts and thanks again!

marcelmanzardo
Автор

So far I watched three calendar VBA video's yours is by far the best, thank you, and great work!

SrMalgato
Автор

Such a clean implementation! This blows my previous attempts out of the water. Works flawlessly and I was even able to copy the modules and form to my personal macro workbook so its functionality is available all the time without installing an add-in. Thank you!

Kailuaboy
Автор

This is so impressive, your vba knowledge is outstanding.

alpeshshah
Автор

Mate please finish this tutorial with all the functionalities, I'm enjoying a lot this project! Congratulations amazing video!

DanielCampos-vlwg
Автор

Sam you Rock. Everybody must definitely download the version built into a workbook in the Q&A section on his site. Works like a charm. My go to version from now on.

francoismarsau
Автор

cam on ban nhieu lam luon a, ne va thuc quy nhung nguoi gioi ma con sẵn sang chia se kien thuc va kinh nghiem cua ban than cho nguoi khac, chuc ban luon thanh cong nhe

maitam
Автор

I love the Dancing sheet. This is magic, and I want add more dancers, but I'm still pretty new to VBA. Also, I may use this to make a button in our add-in to mess with my co-workers. :)

lydiarobinson
Автор

Дякую!!!! Просто і ефективно у викристанні. СУПЕР

cheshirecat
Автор

I like the way you code. I am looking forward for more videos.

sunjivs
Автор

Health to your hands.
Thanks so much for your sharing.
Best wishes for success in your work.👍

abdersoy
Автор

Simply stunning. Thank you for sharing.

martindafieno
Автор

Seing that Samuel is soooh good at we can convince him to do a video and to write us an searchable dropdownlist that recognizes cells that has data validation in them and can work on all versions of excel. Just wishing out loud.

francoismarsau
Автор

Thanks man for this amazing tutorial. I'm extemelly shocked actually and wondering how on earth such a simple feature is not already build in the latest version of Excel from Microsoft Office professional 2021 which costs around 439.99 € officially from Microsoft. At least its not on 64bit version.

ampeg
Автор

Nice stuff... and i like the way you bring it clear, sharp and fast 👍

christophedruon
Автор

the add on works really good! thanks for sharing this. One issue I found, When I enable the "show in grid" feature, which means the icon will be displayed in the cell, the autofill options buttons will disappear...anyway we can fix it?

xinruizhou
Автор

Hi, awesome work, use it all the time.

If possible can you add code to change screens? As I move from left screen to right screen the calander pops up on left screen at the bottom. Any help appreciated

johncameron