Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default dates in dropdown

I would like my user to pick a date from a dropdown
combobox of 30 days. a15=today(), a14=a15-1, a16=a15+1,
etc. This gives me a nice list of current dates. The
problem is when I pick a date, the format in the dropdown
box changes to a number. The dates look fine in my
dropdown but when I select one I lose my formatting and
only have a number showing. THIA for any suggestions!
James

James at Landiscomputer.com
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default dates in dropdown

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

An alternate method would be to use code to load the combobox.

for each cell in Range("A1:A15")
Combobox1.AddItem cell.Text
Next

Then the combobox contains strings which will display correctly when
selected.

--
Regards,
Tom Ogilvy


"James" wrote in message
...
I would like my user to pick a date from a dropdown
combobox of 30 days. a15=today(), a14=a15-1, a16=a15+1,
etc. This gives me a nice list of current dates. The
problem is when I pick a date, the format in the dropdown
box changes to a number. The dates look fine in my
dropdown but when I select one I lose my formatting and
only have a number showing. THIA for any suggestions!
James

James at Landiscomputer.com



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
select From dropdown and return another dropdown menu RE4379 Excel Discussion (Misc queries) 2 March 11th 10 03:09 PM
Dropdown box display only data dependent on another dropdown box? Chris Excel Worksheet Functions 8 August 5th 08 05:01 PM
Dropdown List within a dropdown Henn9660 Excel Worksheet Functions 1 April 10th 08 07:42 PM
offer dropdown options based on another dropdown Conor Excel Discussion (Misc queries) 2 January 13th 06 04:28 PM
How do I create a dropdown within a dropdown? Joyce Keller Excel Discussion (Misc queries) 1 December 5th 05 04:02 PM


All times are GMT +1. The time now is 12:14 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"