Convert date to lowercase month

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Convert date to lowercase month

Post by VegasNath »

I need to convert a date into a lowercase string for a vba variable.

Password2 = Password1 & (LOWER(Text(strDateWork, "mmmm")))

Where am I going wrong? TIA
:wales: Nathan :uk:
There's no place like home.....

User avatar
HansV
Administrator
Posts: 78487
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Convert date to lowercase month

Post by HansV »

LOWER and TEXT are worksheet functions, not VBA functions.
The VBA equivalent of LOWER is LCase.
The VBA equivalent of TEXT is Format.
So try

LCase(Format(strDateWork, "mmmm"))

By the way, shouldn't you use a date variable for the date instead of a string variable? The prefix "str" of the name strDateWork suggests that it is a string variable.
Best wishes,
Hans

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Convert date to lowercase month

Post by VegasNath »

Thanks Hans.
Good point, I keep adopting bad habits.
:wales: Nathan :uk:
There's no place like home.....