filmov
tv
How to Insert Excel Date Picker | Mini Calendar Add-in | Secret VBA Hack!
Показать описание
I added this date picker to my Excel spreadsheet in less than 5 minutes!
One of the biggest complaints people have about Excel is that it’s hard to use. That’s why I always strive to make my spreadsheets as user-friendly as possible.
A date picker can be a game-changer for your spreadsheets because it simplifies the process of selecting dates, making data entry a delightful task.
In this tutorial, you'll learn how to set up this date picker from beginning to end. I’ll also teach you a VBA hack that can make the date picker pop-up only for date cells!
VBA CODE
----------------------------------------
'Put this procedure in your Worksheet's in the Microsoft Excel Objects folder
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
' Check if Active Cell format matches the "Short Date" number format
If ActiveCell.NumberFormat = "m/d/yyyy" Then
' If the Active Cell format is a date, make the calendar visible
ActiveSheet.Shapes("Calendar").Visible = True
' Change the position of the calendar to be just below and to the right of the Active Cell
ActiveSheet.Shapes("Calendar").Left = ActiveCell.Left + ActiveCell.Width
ActiveSheet.Shapes("Calendar").Top = ActiveCell.Top + ActiveCell.Height
' If the Active Cell isn't a date, make the calendar invisible
Else: ActiveSheet.Shapes("Calendar").Visible = False
End If
End Sub
----------------------------------------
00:00 Introduction
00:49 Native Date Picker
01:53 Get Mini Calendar Add-In
02:29 How it Works
04:02 VBA Hack Pop-Up Calendar
07:01 Custom Date Format
Комментарии