September 10, 2020

Universal Date Picker/Calendar with week numbers/ Quick insert current date

(AutoHotkey is really great!)
With AutoHotkey you can very easily get a date picker + small calendar utility displaying also the week numbers.

(This might avoid you implementing forms in vba.)

 

How to install

You can take the code from this Gist and add to your AHK script.
You have it implemented in my TextExpander.ahk
The code is explained in next section.

How to use

Simply hit the hotkeys that trigger these functions.
For my case I use Ctrl+, to insert current date and Ctrl+; to open the date picker.
You can change these hotkeys by editing the ahk file.

I always had implemented in my TextExpander a hotkey (Ctrl+,) to insert the current date.

Now I have another one (Ctrl+.) that will open a small calendar like below:

It displays also the Week numbers.

If you hit Enter or OK it will write the selected date.


Code explanation

The code extract looks like:

It is based on the AHK Gui MonthCal

In the line Gui, Add, MonthCal, 4 vDatePicker, the Options e.g. like 4 to display the Week numbers has to be placed before the last parameter for the value.

If you have some concerns about the week numbering see this forum topic: TL;DR: it isn't AHK fault but Microsoft's.

No comments:

Post a Comment