# Tom’s Tutorials For Excel: ListBox Days & ComboBox Months

Tom’s Tutorials For Excel: ListBox Days & ComboBox Months

In your userform’s module, this Initialize event code populates a ListBox with days of the week, and a ComboBox with months of the year, as seen by example in the picture.

`Private Sub UserForm_Initialize()`

`'Populate a ListBox with days of the week.`
`Dim myarray As Variant`
`myarray = _`
```Split("Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday", "|") ListBox1.List = myarray```

``` 'Populate a ComboBox with months of the year. Dim i% For i = 1 To 12 ComboBox1.AddItem Format(DateSerial(2000, i, 1), "MMMM") Next i End Sub var hupso_services_t=new Array("Twitter","Facebook","Google Plus","Pinterest","Linkedin","Reddit");var hupso_background_t="#EAF4FF";var hupso_border_t="#66CCFF";var hupso_toolbar_size_t="medium";var hupso_image_folder_url = "";var hupso_url_t="";var hupso_title_t="Tom%27s%20Tutorials%20For%20Excel%3A%20ListBox%20Days%20%26%20ComboBox%20Months"; ```
``` ‹ Tom’s Tutorials For Excel: LOOKUP By MIN or MAX Tom’s Tutorials For Excel: Count Percentages in a Range › Posted in Tom's Tutorials for Excel Tags: ActiveX / Form Controls, Analytics, Big Data, Business Intelligence, Data Science, Date Time, Excel Expert, Excel Guru, Macros Events Classes API, Microsoft, Microsoft Excel, Microsoft MVP, Microsoft Office, Tom Urtis, UserForms ```
``` One comment on “Tom’s Tutorials For Excel: ListBox Days & ComboBox Months” Abdul Sabrah says: January 5, 2022 at 11:21 am Public Sub PopulateDays() ‘Populate a ListBox with days of the week. Dim myarray(1 To 7) As Variant Dim i As Long For i = 1 To 7 myarray(i) = WeekdayName(i, False) Next Me.ListBox1.List = myarray Dim mntharry(1 To 12) As String For i = 1 To 12 mntharry(i) = MonthName(i, False) Next Me.ComboBox1.List = mntharry End Sub Reply Leave a Reply Your email address will not be published. Required fields are marked *Comment * Name * E-mail * Δdocument.getElementById( "ak_js_1" ).setAttribute( "value", ( new Date() ).getTime() ); ```
``` CATEGORIESActiveX / Form Controls (10)Array Formulas (27)Cells Ranges Lists (122)Charts and Chart Sheets (1)Comments / Screen Tips (9)Conditional Formatting (15)Cut Copy Paste Clear Fill (16)Data validation (12)Date Time (53)Duplicates Uniques (13)Filter Subtotal Group (9)Find Replace Substitute (18)Formats Fonts Styles Colors (49)Formulas Functions (152)Keyboard Mouse (35)Links Hyperlinks Web Email (12)Macros Events Classes API (110)Numbers and Decimals (49)Pictures Shapes Graphics (4)Pivot Tables / Pivot Charts (10)Printing Page Setup (7)Sort (7)Text and Constants (19)Tips and Tricks (55)User-Defined Functions (6)UserForms (10)Word Outlook Access PPT (8)Worksheets Workbooks (60) Tweets by @TomUrtis !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); ```
``` ```
``` (function () { var c = document.body.className; c = c.replace(/woocommerce-no-js/, 'woocommerce-js'); document.body.className = c; })(); /* <![CDATA[ */ var BG_SHCE_USE_EFFECTS = "0"; var BG_SHCE_TOGGLE_SPEED = "400"; var BG_SHCE_TOGGLE_OPTIONS = "none"; var BG_SHCE_TOGGLE_EFFECT = "blind"; /* ]]> */ /* <![CDATA[ */ var wc_order_attribution = {"params":{"lifetime":1.0000000000000000818030539140313095458623138256371021270751953125e-5,"session":30,"ajaxurl":"https:\/\/www.atlaspm.com\/wp-admin\/admin-ajax.php","prefix":"wc_order_attribution_","allowTracking":true},"fields":{"source_type":"current.typ","referrer":"current_add.rf","utm_campaign":"current.cmp","utm_source":"current.src","utm_medium":"current.mdm","utm_content":"current.cnt","utm_id":"current.id","utm_term":"current.trm","session_entry":"current_add.ep","session_start_time":"current_add.fd","session_pages":"session.pgs","session_count":"udata.vst","user_agent":"udata.uag"}}; /* ]]> */ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','https://www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-96540138-1', 'auto'); ga('send', 'pageview'); San Francisco, California1-925-310-4170tom@atlaspm.comdocument.body.style.setProperty( "padding-bottom", document.getElementById('scb-wrapper').offsetHeight+'px', "important" ); ```