I've got a month number. By typing in the immediate editor MonthName(11,True) I get the result NOV. What would be the inverse of this function? e.g. I've got SEP and I want by typing function(SEP) the number 9 as an Output
Asked
Active
Viewed 3,289 times
1 Answers
3
You are looking for this:
Sub Sample()
Dim MonthNm As String
MonthNm = "September"
Debug.Print Month(DateValue("01 " & MonthNm & " 2014"))
End Sub
or in small:
=MONTH(DATEVALUE(A1&"9"))

Rahul Tripathi
- 168,305
- 31
- 280
- 331