ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ComboBox - Excel (https://www.excelbanter.com/excel-programming/285580-combobox-excel.html)

sarah

ComboBox - Excel
 
Hi,

i have a problem when i choose a date in the combobox; for example, my
list contains some dates (08/05/2003 etc) and when i choose a
date,this is the number 37839 that appears.
How can I do to make visible the date and not the number?
Thanks,

Sarah

Nick Hodge

ComboBox - Excel
 
Sarah

Format it. The number is simply how Excel stores dates (days are whole
numbers since 1/1/1900, times are decimals of a day)

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS



sarah wrote:
Hi,

i have a problem when i choose a date in the combobox; for example, my
list contains some dates (08/05/2003 etc) and when i choose a
date,this is the number 37839 that appears.
How can I do to make visible the date and not the number?
Thanks,

Sarah




Tom Ogilvy

ComboBox - Excel
 
Private Sub Combobox1_Click()
Combobox1.Value = Format(clng(Combobox1.Value),"mm/dd/yyyy")
End Sub

--
Regards,
Tom Ogilvy

"sarah" wrote in message
om...
Hi,

i have a problem when i choose a date in the combobox; for example, my
list contains some dates (08/05/2003 etc) and when i choose a
date,this is the number 37839 that appears.
How can I do to make visible the date and not the number?
Thanks,

Sarah




Nick Hodge

ComboBox - Excel
 
Sarah

Sorry fogot I was in the programming group. My reason still holds, but see
Tom's answer in code

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS



Nick Hodge wrote:
Sarah

Format it. The number is simply how Excel stores dates (days are
whole numbers since 1/1/1900, times are decimals of a day)


sarah wrote:
Hi,

i have a problem when i choose a date in the combobox; for example,
my list contains some dates (08/05/2003 etc) and when i choose a
date,this is the number 37839 that appears.
How can I do to make visible the date and not the number?
Thanks,

Sarah





All times are GMT +1. The time now is 06:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com