LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default help with dates on form combobox

Hi,

I've created a userform which is a calendar. The month displayed is
controlled by a combobox on the userform, so whichever month selected
in the combobox controls the dates displayed in the textboxes below.

I have a problem however. The months available to select in the
combobox are;
May-08
Jun-08
Jul-08
Aug-08
Sep-08
Oct-08
Nov-08
Dec-08
Jan-09
Feb-09
Mar-09
Apr-09
May-09
Jun-09
Jul-09

These are in a sheet on my workbook and the combobox rowsource is set
to sheet4!af1:sheet4!af15 (where these are located). The code that
runs when a user makes a selection;

Private Sub ComboBox1_Change()
UserForm5.Controls("ComboBox1").Value =
Format(UserForm5.Controls("ComboBox1").Value, "mmm-yy")

If ComboBox1.Value = "May-08" Then Call may08
If ComboBox1.Value = "Jun-08" Then Call june08
If ComboBox1.Value = "Jul-08" Then Call july08
If ComboBox1.Value = "Aug-08" Then Call august08
If ComboBox1.Value = "Sep-08" Then Call september08
If ComboBox1.Value = "Oct-08" Then Call october08
If ComboBox1.Value = "Nov-08" Then Call november08
If ComboBox1.Value = "Dec-08" Then Call december08
If ComboBox1.Value = "Jan-09" Then Call january09
If ComboBox1.Value = "Feb-09" Then Call february09
If ComboBox1.Value = "Mar-09" Then Call march09
If ComboBox1.Value = "Apr-09" Then Call april09
If ComboBox1.Value = "May-09" Then Call may09
If ComboBox1.Value = "Jun-09" Then Call june09
If ComboBox1.Value = "Jul-09" Then Call july09
End Sub

When i load the form and select the combobox I can see all of the
options, however if I select a month in 2009 the combobox defaults to
the same month in 2008. So if I select Jul-09 from the combobox the
combobox shows Jul-08 and therefore the dates shown in my textboxes
are July 2008 dates.

I have checked all of the sub's named in the code exist but cannot
figure why this is happening. Does anyone have any ideas?
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
form control combobox Gail Excel Discussion (Misc queries) 7 October 2nd 09 07:27 PM
Form Help - ComboBox - VBA jlclyde Excel Discussion (Misc queries) 5 January 13th 09 08:20 PM
link form combobox hngo Excel Worksheet Functions 0 July 28th 06 03:38 PM
Form ComboBox problem [email protected] Excel Programming 0 April 21st 06 03:49 PM
VBA Form ComboBox question WTG Excel Worksheet Functions 3 February 26th 05 04:27 PM


All times are GMT +1. The time now is 01:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"