VBA/Excel/Access/Word/Date Functions/MonthName

Материал из VB Эксперт
Перейти к: навигация, поиск

MonthName(Month(Date))

   <source lang="vb">

Sub Main6()

  Debug.Print "Today"s date is: " & Date
  Debug.Print "The name of the month is: " & MonthName(Month(Date))

End Sub

</source>
   
  


MonthName(Month(Date), True)

   <source lang="vb">

Sub Main7()

  Debug.Print "Today"s date is: " & Date
  Debug.Print "The month abbreviated is: " & MonthName(Month(Date), True)

End Sub

</source>
   
  


MonthName(month) returns A String containing the name of the month represented by month

   <source lang="vb">

Sub dateDemo9()

  Debug.Print MonthName(Month(Date))

End Sub

</source>
   
  


MonthName returns the text string associated with a month number:

   <source lang="vb">

Sub MonthNameExample()

   Debug.Print MonthName(7)
   "Returns July
   Debug.Print MonthName(11)
   "Returns November

End Sub

</source>