Results 1 to 4 of 4

userform combobox to show current month

Threaded View

losmi8 userform combobox to show... 02-24-2010, 11:43 PM
quekbc Re: userform combobox to show... 02-24-2010, 11:53 PM
tokhimi Re: userform combobox to show... 02-17-2014, 04:42 AM
Norie Re: userform combobox to show... 02-17-2014, 04:45 AM
  1. #1
    Forum Contributor
    Join Date
    05-09-2009
    Location
    Chicago, US
    MS-Off Ver
    Excel 2003, Excel 2007
    Posts
    188

    userform combobox to show current month

    hi guys. i have a user form which has "start date" and "end date"

    both have one combobox, which lists months Jan to Dec..and then there are two text boxes where a user inputs a day (ex: 14) and a year (ex: 2009)

    Here is the code:

    Private Sub UserForm_Initialize()
    
    With cbxEndMonth
    .AddItem "Jan"
    .AddItem "Feb"
    .AddItem "Mar"
    .AddItem "Apr"
    .AddItem "May"
    .AddItem "Jun"
    .AddItem "Jul"
    .AddItem "Aug"
    .AddItem "Sep"
    .AddItem "Oct"
    .AddItem "Nov"
    .AddItem "Dec"
    End With
    
    cbxEndMonth.ListIndex = 0
    
    With cbxStartMonth
    .AddItem "Jan"
    .AddItem "Feb"
    .AddItem "Mar"
    .AddItem "Apr"
    .AddItem "May"
    .AddItem "Jun"
    .AddItem "Jul"
    .AddItem "Aug"
    .AddItem "Sep"
    .AddItem "Oct"
    .AddItem "Nov"
    .AddItem "Dec"
    End With
    
    cbxStartMonth.ListIndex = 0
    
    End Sub
    I would like to have the current date show up in the "end date". So I would like the cbxEndMonth checkbox to show the current month, and the end day ("txtEndDay") and end year ("txtEndYear") show the current day and year.

    So when a open a user form, it'll display nothing in the first (start date) inputs and have the current

    Feb (in checkbox) 24 (in text box ) and 2010 (in other text box) in the End Date section.



    Is that possible? Thank you all in advance!
    Last edited by losmi8; 02-25-2010 at 01:42 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1