Record a macro using VBA in Excel

I already used this code: year () to get the current year. But I need only the last two digits of the year. For example, from today, 01/19/2017, I only want to pull up and display a message box containing "17". How to write this code on Macro using VBA in Excel?

+4
source share
1 answer

Try the following:

MsgBox Format(Date, "yy")

+5
source

Source: https://habr.com/ru/post/1667293/


All Articles