Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default UserForm ComboBox Date Format

I created a UserForm that utilizing a ComboBox that you can select
specific range of dates.

I would like the format of the date to show up like S.07 for a date of
09/07/2009. When I run the program and you click the down arrow of the
ComboBox input, the dates are in the right format. When you select a
date from the ComboBox drop down list, the format changes from S.07 to
September9.12 inside the ComboBox input and the output cell to the
spreadsheet also gets that September9.12 format.

Here is a sample of the code I have for both the UserForm and ComboBox

Private Sub UserForm_Click()
UserForm.Value = Format(UserForm.Value, "mmmmm.dd")
End Sub


Private Sub NCAADateInput_Change()
NCAADateInput.Value = Format(NCAADateInput.Value, "mmmmm.dd")
Worksheets("Main").Range("O1").Value = NCAADateInput.Value
End Sub

The custom mmmmm.dd format works just like I want inside the excel
spreadsheet when you format cells.

Any help would be greatly appreciated. Thanks in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default UserForm ComboBox Date Format

Untested, but something like this, perhaps:
Private Sub ComboBox1_Change()
If ComboBox1.Value < "" Then
ComboBox1.Value = Format(ComboBox1.Value, "dd/mm/yyyy")
End If
End Sub

HTH,
Ryan---
--
Ryan---
If this information was helpful, please indicate this by clicking ''Yes''.


"LSU_Richoux" wrote:

I created a UserForm that utilizing a ComboBox that you can select
specific range of dates.

I would like the format of the date to show up like S.07 for a date of
09/07/2009. When I run the program and you click the down arrow of the
ComboBox input, the dates are in the right format. When you select a
date from the ComboBox drop down list, the format changes from S.07 to
September9.12 inside the ComboBox input and the output cell to the
spreadsheet also gets that September9.12 format.

Here is a sample of the code I have for both the UserForm and ComboBox

Private Sub UserForm_Click()
UserForm.Value = Format(UserForm.Value, "mmmmm.dd")
End Sub


Private Sub NCAADateInput_Change()
NCAADateInput.Value = Format(NCAADateInput.Value, "mmmmm.dd")
Worksheets("Main").Range("O1").Value = NCAADateInput.Value
End Sub

The custom mmmmm.dd format works just like I want inside the excel
spreadsheet when you format cells.

Any help would be greatly appreciated. Thanks in advance.

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
Format Date ComboBox Blobbies Excel Discussion (Misc queries) 4 January 10th 08 08:40 AM
format of combobox on userform red6000 Excel Programming 2 July 19th 06 04:22 AM
format combobox in userform to accept dates Brad Excel Worksheet Functions 3 November 2nd 05 01:11 AM
Userform: Combobox, dates, match required- can't get date format to work KR Excel Programming 2 November 10th 04 05:18 PM
Userform Combobox to choose date Rob Excel Programming 2 February 11th 04 12:19 PM


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