ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Converting months as # to Text Month (https://www.excelbanter.com/excel-programming/376841-converting-months-text-month.html)

Barb Reinhardt

Converting months as # to Text Month
 
Programmatically, how would I convert the month from 1-12 to January -
December. Let's assume my variable for month is called MONTH.

Thanks

Jim Thomlinson

Converting months as # to Text Month
 
This should be close...

Dim intMonth As Integer

intMonth = 5
MsgBox Format(DateSerial(2000, intMonth, 1), "mmm")

--
HTH...

Jim Thomlinson


"Barb Reinhardt" wrote:

Programmatically, how would I convert the month from 1-12 to January -
December. Let's assume my variable for month is called MONTH.

Thanks


Les Stout[_2_]

Converting months as # to Text Month
 
Hi Barb,

you could try:-

Sub Month()

Dim Mnth As String
Mnth = Format(Date, "mmmm")
MsgBox "This month is : " & Mnth

End Sub


Les Stout

*** Sent via Developersdex http://www.developersdex.com ***


All times are GMT +1. The time now is 03:45 AM.

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