ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Get month from date (https://www.excelbanter.com/excel-discussion-misc-queries/54441-get-month-date.html)

[email protected]

Get month from date
 
Useing VBA, how to I get the month from a date in range("a1") as text.
Eg if date = 30/1/02, Month = "January" or 30/10/05 then month =
"October". I want to worksheets with the month.
Regards Robert


Niek Otten

Get month from date
 
MonthA = format(range("a1"),"mmmm")

--
Kind regards,

Niek Otten

wrote in message
oups.com...
Useing VBA, how to I get the month from a date in range("a1") as text.
Eg if date = 30/1/02, Month = "January" or 30/10/05 then month =
"October". I want to worksheets with the month.
Regards Robert




Dave Peterson

Get month from date
 
Another way, depending on what version of excel you're using:

MsgBox MonthName(Month(Date))

(I think xl2k added MonthName...)

wrote:

Useing VBA, how to I get the month from a date in range("a1") as text.
Eg if date = 30/1/02, Month = "January" or 30/10/05 then month =
"October". I want to worksheets with the month.
Regards Robert


--

Dave Peterson


All times are GMT +1. The time now is 07:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com