Excel VBA Basics #26 WeekdayName and MonthName in VBA

preview_player
Показать описание

Easily get the short name or full name of the weekday or the month. Examples are

answer=WeekdayName("1/1/2013")
the value for answer would be "Tuesday"

answer=MonthName("2/14/2016")
where answer would be "February"

Fantastic Developer Tools:
Рекомендации по теме
Комментарии
Автор

I love that the mastah, mr excel came by and posted! I love his channel, and this is an excellent compliment to his legacy. Keep up the fantastic work Dan, I am a fan bro!

jetpaq
Автор

Charlotte, you can get the last 2 digits of a year using Format(). so If you made a variable take on the last two it may look something like this.


last2=Format(myDate, "yy")

Dan

ExcelVbaIsFun
Автор

You're very welcome, johnyraku! Thanks!

ExcelVbaIsFun
Автор

Thank you so much Dan for all your tutorial videos!!! Really really great and helpful!
May I ask how I can extract the last two digits of a year? Or is there an easy way to convert the vbdate to dd-mmm-yy format? (I use this format because I couldn't name the worksheets as dd/mm/yy :( I am using your date picker to decide which worksheet to open.
Thank you!!!

DrCharTang
Автор

it's been great help but i don't get any values using square bracket [] i.e. [a1]. Could you tell me why is that.

lekshey