{"id":3172,"date":"2021-03-28T18:26:11","date_gmt":"2021-03-29T01:26:11","guid":{"rendered":"https:\/\/SUMMALAI.COM\/?p=3172"},"modified":"2021-03-28T18:26:12","modified_gmt":"2021-03-29T01:26:12","slug":"how-to-use-the-monthname-function-vba","status":"publish","type":"post","link":"https:\/\/SUMMALAI.COM\/?p=3172","title":{"rendered":"How to Use the MONTHNAME Function (VBA)"},"content":{"rendered":"\n<p>This Excel tutorial explains how to use the Excel&nbsp;<strong>MONTHNAME function<\/strong>&nbsp;with syntax and examples.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Description<\/h3>\n\n\n\n<p>The Microsoft Excel MONTHNAME function returns a string representing the month given a number from 1 to 12.<\/p>\n\n\n\n<p>The MONTHNAME function is a built-in function in Excel that is categorized as a&nbsp;<em>Date\/Time Function<\/em>. It can be used as a VBA function (VBA) in Excel. As a VBA function, you can use this function in&nbsp;<a href=\"https:\/\/www.techonthenet.com\/excel\/macros\/index.php\">macro code<\/a>&nbsp;that is entered through the Microsoft Visual Basic Editor.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Syntax<\/h3>\n\n\n\n<p>The syntax for the MONTHNAME function in Microsoft Excel is:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">MonthName( number, [ abbreviate ] )<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters or Arguments<\/h3>\n\n\n\n<p>numberA value from 1 to 12, representing the month.abbreviateOptional. This parameter accepts a boolean value, either TRUE or FALSE. If this parameter is set to TRUE, it means that the month name is abbreviated. If this parameter is set to FALSE, the month name is&nbsp;<strong>not<\/strong>&nbsp;abbreviated. If this parameter is omitted, it defaults to FALSE.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Returns<\/h3>\n\n\n\n<p>The MONTHNAME function returns a string value.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Applies To<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Excel for Office 365, Excel 2019, Excel 2016, Excel 2013, Excel 2011 for Mac, Excel 2010, Excel 2007, Excel 2003, Excel XP, Excel 2000<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">Example (as VBA Function)<\/h3>\n\n\n\n<p>The MONTHNAME function can only be used in VBA code in Microsoft Excel.<\/p>\n\n\n\n<p>Let&#8217;s look at some Excel MONTHNAME function examples and explore how to use the MONTHNAME function in Excel VBA code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">MonthName(3)\n<em>Result:<\/em> 'March'\n\nMonthName(3, TRUE)\n<em>Result:<\/em> 'Mar'\n\nMonthName(7, FALSE)\n<em>Result:<\/em> 'July'<\/pre>\n\n\n\n<p>For example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Dim LValue As String\n\nLValue = MonthName(3, TRUE)<\/pre>\n\n\n\n<p>In this example, the variable called LValue would now contain the value of &#8216;Mar&#8217;.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This Excel tutorial explains how to use the Excel&nbsp;MONTHNAME function&nbsp;with syntax and examples. Description The Microsoft Excel MONTHNAME function returns a string representing the month given a number from 1 to 12. The MONTHNAME function is a built-in function in Excel that is categorized as a&nbsp;Date\/Time Function. It can be used as a VBA function <a class=\"read-more\" href=\"https:\/\/SUMMALAI.COM\/?p=3172\">Read More<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[10,18],"tags":[658],"class_list":["post-3172","post","type-post","status-publish","format-standard","hentry","category-microsoft","category-microsoft-office","tag-monthname"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3172"}],"version-history":[{"count":1,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3172\/revisions"}],"predecessor-version":[{"id":3173,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=\/wp\/v2\/posts\/3172\/revisions\/3173"}],"wp:attachment":[{"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/SUMMALAI.COM\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}