#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Combo Box Display

Hello Folks

Using VB 6.3
I have a combo box in a user for for selecting certain dates from the
spreadsheet. The drop down works ok, but when I select a date the
information displayed in the window is not the date.

For instance I select 02/09/07 and the displayed value is 39122.
How do I get the window to display 02/09/07 as opposed to 39122.

I have the same problem with a time combo box.

Thanks for your help
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,942
Default Combo Box Display

hi,
39122 is the date number for 2/9/07.
in your code you need to pre-format the cell to date. it should display date
then.

Regards
FSt1

"bob leathers" wrote:

Hello Folks

Using VB 6.3
I have a combo box in a user for for selecting certain dates from the
spreadsheet. The drop down works ok, but when I select a date the
information displayed in the window is not the date.

For instance I select 02/09/07 and the displayed value is 39122.
How do I get the window to display 02/09/07 as opposed to 39122.

I have the same problem with a time combo box.

Thanks for your help

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Combo Box Display

How are you adding the items to the combobox?

Maybe it would be better to use something like:
me.combobox1.additem format(whereeveryougetthedate, "mm/dd/yyyy")

If this isn't sufficient, post back with some more details.

Is the combobox on a userform -- or on a worksheet. And if it's on a worksheet,
did you use the combobox from the control toolbox toolbar or from the dropdown
toolbar?



bob leathers wrote:

Hello Folks

Using VB 6.3
I have a combo box in a user for for selecting certain dates from the
spreadsheet. The drop down works ok, but when I select a date the
information displayed in the window is not the date.

For instance I select 02/09/07 and the displayed value is 39122.
How do I get the window to display 02/09/07 as opposed to 39122.

I have the same problem with a time combo box.

Thanks for your help


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 7
Default Combo Box Display



BTW I am also using Excel 2003
I am adding the data to a userform combo box from Cells in a spreadsheet
(in combo box properties Row Source AA2:AA12). The cell Formats in the
spreadsheet are "mm/dd/yy". When the user opens the form to add the date
this data is displayed properly in the dropdown. When you select the
date you want the serial date is substituted in the combo box window. I
need to format the combo box to a "mm/dd/yy" format but don't know how.

The same applies to the time function in another combo Box. Drpo down
displays properly but serial time is displayed. I need to format this to
a "hh:mm" format but again don't know how

Thanks


In article ,
says...
How are you adding the items to the combobox?

Maybe it would be better to use something like:
me.combobox1.additem format(whereeveryougetthedate, "mm/dd/yyyy")

If this isn't sufficient, post back with some more details.

Is the combobox on a userform -- or on a worksheet. And if it's on a worksheet,
did you use the combobox from the control toolbox toolbar or from the dropdown
toolbar?



bob leathers wrote:

Hello Folks

Using VB 6.3
I have a combo box in a user for for selecting certain dates from the
spreadsheet. The drop down works ok, but when I select a date the
information displayed in the window is not the date.

For instance I select 02/09/07 and the displayed value is 39122.
How do I get the window to display 02/09/07 as opposed to 39122.

I have the same problem with a time combo box.

Thanks for your help



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Combo Box Display

Drop the rowsource and use .additem inside the userform_initialize event.


Option Explicit
Private Sub UserForm_Initialize()
Dim myCell As Range
For Each myCell In Worksheets("sheet999").Range("aa2:aa12").Cells
Me.ComboBox1.AddItem myCell.Text 'or format(mycell.value,"mm/dd/yyyy")
Next myCell
End Sub

And do the same thing with the times.

bob leathers wrote:

BTW I am also using Excel 2003
I am adding the data to a userform combo box from Cells in a spreadsheet
(in combo box properties Row Source AA2:AA12). The cell Formats in the
spreadsheet are "mm/dd/yy". When the user opens the form to add the date
this data is displayed properly in the dropdown. When you select the
date you want the serial date is substituted in the combo box window. I
need to format the combo box to a "mm/dd/yy" format but don't know how.

The same applies to the time function in another combo Box. Drpo down
displays properly but serial time is displayed. I need to format this to
a "hh:mm" format but again don't know how

Thanks

In article ,
says...
How are you adding the items to the combobox?

Maybe it would be better to use something like:
me.combobox1.additem format(whereeveryougetthedate, "mm/dd/yyyy")

If this isn't sufficient, post back with some more details.

Is the combobox on a userform -- or on a worksheet. And if it's on a worksheet,
did you use the combobox from the control toolbox toolbar or from the dropdown
toolbar?



bob leathers wrote:

Hello Folks

Using VB 6.3
I have a combo box in a user for for selecting certain dates from the
spreadsheet. The drop down works ok, but when I select a date the
information displayed in the window is not the date.

For instance I select 02/09/07 and the displayed value is 39122.
How do I get the window to display 02/09/07 as opposed to 39122.

I have the same problem with a time combo box.

Thanks for your help




--

Dave Peterson


Reply
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
Combo Box Properties Squeaky Excel Discussion (Misc queries) 0 December 20th 06 03:44 PM
Using Drop Downs Or Combo Boxes to Look up and display Info Wyveryn Excel Discussion (Misc queries) 2 October 4th 06 02:43 AM
Combo Box David French Excel Worksheet Functions 0 October 3rd 05 06:02 PM
How do you display Greek and Russian languages in excel? Mark Hayden Excel Discussion (Misc queries) 1 August 1st 05 08:06 AM
how i choose the column from a combo box Alberto Vargas Excel Discussion (Misc queries) 4 July 22nd 05 11:07 PM


All times are GMT +1. The time now is 04:47 PM.

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

About Us

"It's about Microsoft Excel"