View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Nick Hodge[_2_] Nick Hodge[_2_] is offline
external usenet poster
 
Posts: 185
Default Date Formatting Within A Combo Box On A Userform

Div

It appears as a serial date where? If it is on a worksheet just format it,
if it arrives into a variable in your code you may need to specifically
parse it, e.g

Private Sub ComboBox1_Change()
Dim myUKDate As String
myUKDate = Format(Me.ComboBox1.Value, "dd/mm/yyyy")
MsgBox myUKDate
End Sub
--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
DTHIS
web:
www.excelusergroup.org
web: www.nickhodge.co.uk





"Div" <u43652@uwe wrote in message news:844d1c0356ed4@uwe...
Hi All,

Using Excel 2007 I have a combo box with a row source of dates linked to a
column of worksheet cells. The cells on the worksheet are UK formatted as
dd/mm/yy and appear as such. The form opens and when a user clicks on the
combo box the dates can be viewed correctly - so far so good. The problem
I
need help with is when the user (me) selects a date from the list it
appears
as a date serial number and not in the anticipated format. Any help with
this
would be greatly appreciated.

Regards - Div