#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Format Date ComboBox

I have a userform that has two date comboboxes.

The second combobox dates (days of the applicable working week) are reliant
on the whatever date (paydate) is selected.

The listed dates within each combo box are in the format [dd-mm-yy], but
once they are selected on the userform, they revert to a serial number date.

Is the anyway of retaining the [dd-mm-yy] format when the date is selected
on the userform?

Many thanks in advance for your help!!!



Edi, NZ
  #2   Report Post  
Posted to microsoft.public.excel.misc
TWR TWR is offline
external usenet poster
 
Posts: 30
Default Format Date ComboBox

You may want to ask this question in the Excel Programming section, rather
than the General Questions section.

Do the second combo's values change based on the selection in the first combo?

"Blobbies" wrote:

I have a userform that has two date comboboxes.

The second combobox dates (days of the applicable working week) are reliant
on the whatever date (paydate) is selected.

The listed dates within each combo box are in the format [dd-mm-yy], but
once they are selected on the userform, they revert to a serial number date.

Is the anyway of retaining the [dd-mm-yy] format when the date is selected
on the userform?

Many thanks in advance for your help!!!



Edi, NZ

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 20
Default Format Date ComboBox

On Jan 9, 8:49*pm, Blobbies
wrote:
I have a userform that has two date comboboxes.

The second combobox dates (days of the applicable working week) are reliant
on the whatever date (paydate) is selected.

The listed dates within each combo box are in the format [dd-mm-yy], but
once they are selected on the userform, they revert to a serial number date.

Is the anyway of retaining the [dd-mm-yy] format when the date is selected
on the userform?

Many thanks in advance for your help!!!

Edi, NZ


I had the same issue. You have to format the combo box using VBA.
There is probably a better way, but this one works.

Private Sub ComboBox1_Change()
MyDate = Format(ComboBox1.Value, "mm/d/yyyy")
ComboBox1.Value = Format(MyDate, "mm/d/yyyy")
End Sub
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Format Date ComboBox

Hi TWR

Thanks for the time you took to consider my problem!! Adam has helped me
out below !!

Many thanks



Edi


"TWR" wrote:

You may want to ask this question in the Excel Programming section, rather
than the General Questions section.

Do the second combo's values change based on the selection in the first combo?

"Blobbies" wrote:

I have a userform that has two date comboboxes.

The second combobox dates (days of the applicable working week) are reliant
on the whatever date (paydate) is selected.

The listed dates within each combo box are in the format [dd-mm-yy], but
once they are selected on the userform, they revert to a serial number date.

Is the anyway of retaining the [dd-mm-yy] format when the date is selected
on the userform?

Many thanks in advance for your help!!!



Edi, NZ

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default Format Date ComboBox

Thanks Adam - That seems to work a treat, although upsets things further on
in the code when it's simply searching for the date in General format, and
it's been converted to dd/mm/yy!! Nevermind .... I'll work my way around
that!!


Cheers!!



Edi

" wrote:

On Jan 9, 8:49 pm, Blobbies
wrote:
I have a userform that has two date comboboxes.

The second combobox dates (days of the applicable working week) are reliant
on the whatever date (paydate) is selected.

The listed dates within each combo box are in the format [dd-mm-yy], but
once they are selected on the userform, they revert to a serial number date.

Is the anyway of retaining the [dd-mm-yy] format when the date is selected
on the userform?

Many thanks in advance for your help!!!

Edi, NZ


I had the same issue. You have to format the combo box using VBA.
There is probably a better way, but this one works.

Private Sub ComboBox1_Change()
MyDate = Format(ComboBox1.Value, "mm/d/yyyy")
ComboBox1.Value = Format(MyDate, "mm/d/yyyy")
End Sub

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
OFFSET for multiple columns & combobox format sahafi Charts and Charting in Excel 2 April 30th 07 02:28 PM
Changing the format of a cell after choosing from a combobox. David A. Excel Discussion (Misc queries) 0 March 21st 07 01:43 PM
format combobox in userform to accept dates Brad Excel Worksheet Functions 3 November 2nd 05 01:11 AM
Number format for Combobox MBlake Excel Discussion (Misc queries) 1 June 29th 05 03:25 AM
Excel 2000 date format cannot be set to Australian date format Brian Jones Excel Discussion (Misc queries) 1 March 30th 05 06:03 AM


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