Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default month
Using XL 2000, i'm populating a combobox using:
With Month .AddItem "January" '0 .AddItem "February" '1 .AddItem "March" '2 .AddItem "April" '3 .AddItem "May" '4 .AddItem "June" '5 .AddItem "July" '6 .AddItem "August" '7 .AddItem "September" '8 .AddItem "October" '9 .AddItem "November" '10 .AddItem "December" '11 End With I would like the current month to default in the combobx. any ideas appreciated. Thanks, Paul |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default month
Hi Paul,
Something like this should work for you: .Value = Format$(Date, "Mmmm") One comment - I would pick a different name for your ComboBox, as Month is a reserved keyword. I don't think it will cause any problems, but better safe than sorry. I typically use "cbo" in front of a ComboBox name so I know at first glance what type of object it is. So you could use "cboMonth" or similar. -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Paul wrote: Using XL 2000, i'm populating a combobox using: With Month .AddItem "January" '0 .AddItem "February" '1 .AddItem "March" '2 .AddItem "April" '3 .AddItem "May" '4 .AddItem "June" '5 .AddItem "July" '6 .AddItem "August" '7 .AddItem "September" '8 .AddItem "October" '9 .AddItem "November" '10 .AddItem "December" '11 End With I would like the current month to default in the combobx. any ideas appreciated. Thanks, Paul |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default month
Good thinking Jake,
solution works fine. Thanks, Paul -----Original Message----- Hi Paul, Something like this should work for you: .Value = Format$(Date, "Mmmm") One comment - I would pick a different name for your ComboBox, as Month is a reserved keyword. I don't think it will cause any problems, but better safe than sorry. I typically use "cbo" in front of a ComboBox name so I know at first glance what type of object it is. So you could use "cboMonth" or similar. -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Paul wrote: Using XL 2000, i'm populating a combobox using: With Month .AddItem "January" '0 .AddItem "February" '1 .AddItem "March" '2 .AddItem "April" '3 .AddItem "May" '4 .AddItem "June" '5 .AddItem "July" '6 .AddItem "August" '7 .AddItem "September" '8 .AddItem "October" '9 .AddItem "November" '10 .AddItem "December" '11 End With I would like the current month to default in the combobx. any ideas appreciated. Thanks, Paul . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default month
With Month
.AddItem "January" '0 .AddItem "February" '1 .AddItem "March" '2 .AddItem "April" '3 .AddItem "May" '4 .AddItem "June" '5 .AddItem "July" '6 .AddItem "August" '7 .AddItem "September" '8 .AddItem "October" '9 .AddItem "November" '10 .AddItem "December" '11 .ListIndex = Month(Date)-1 End With -- Regards, Tom Ogilvy "Paul" wrote in message ... Using XL 2000, i'm populating a combobox using: With Month .AddItem "January" '0 .AddItem "February" '1 .AddItem "March" '2 .AddItem "April" '3 .AddItem "May" '4 .AddItem "June" '5 .AddItem "July" '6 .AddItem "August" '7 .AddItem "September" '8 .AddItem "October" '9 .AddItem "November" '10 .AddItem "December" '11 End With I would like the current month to default in the combobx. any ideas appreciated. Thanks, Paul |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default month
For information:
? Format$(Date, "Mmmm") October ? format$(date,"mMmM") October -- Regards, Tom Ogilvy "Jake Marx" wrote in message ... Hi Paul, Something like this should work for you: .Value = Format$(Date, "Mmmm") One comment - I would pick a different name for your ComboBox, as Month is a reserved keyword. I don't think it will cause any problems, but better safe than sorry. I typically use "cbo" in front of a ComboBox name so I know at first glance what type of object it is. So you could use "cboMonth" or similar. -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Paul wrote: Using XL 2000, i'm populating a combobox using: With Month .AddItem "January" '0 .AddItem "February" '1 .AddItem "March" '2 .AddItem "April" '3 .AddItem "May" '4 .AddItem "June" '5 .AddItem "July" '6 .AddItem "August" '7 .AddItem "September" '8 .AddItem "October" '9 .AddItem "November" '10 .AddItem "December" '11 End With I would like the current month to default in the combobx. any ideas appreciated. Thanks, Paul |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Default month
Thanks, Tom. Actually, I like your ListIndex method better.
-- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Tom Ogilvy wrote: For information: ? Format$(Date, "Mmmm") October ? format$(date,"mMmM") October "Jake Marx" wrote in message ... Hi Paul, Something like this should work for you: .Value = Format$(Date, "Mmmm") One comment - I would pick a different name for your ComboBox, as Month is a reserved keyword. I don't think it will cause any problems, but better safe than sorry. I typically use "cbo" in front of a ComboBox name so I know at first glance what type of object it is. So you could use "cboMonth" or similar. -- Regards, Jake Marx www.longhead.com [please keep replies in the newsgroup - email address unmonitored] Paul wrote: Using XL 2000, i'm populating a combobox using: With Month .AddItem "January" '0 .AddItem "February" '1 .AddItem "March" '2 .AddItem "April" '3 .AddItem "May" '4 .AddItem "June" '5 .AddItem "July" '6 .AddItem "August" '7 .AddItem "September" '8 .AddItem "October" '9 .AddItem "November" '10 .AddItem "December" '11 End With I would like the current month to default in the combobx. any ideas appreciated. Thanks, Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Change Default Auto-Fill-In month | Excel Discussion (Misc queries) | |||
Enter day, default month and year | Excel Discussion (Misc queries) | |||
Default to month end | Excel Discussion (Misc queries) | |||
How to manage/change the default month/day date format? | Excel Discussion (Misc queries) | |||
Default to beginning of month | Excel Worksheet Functions |