Format in a combobox

G

Guest

Hi
I have again a problem whith format
i have yhis
Dim rng2 As Range
Set rng2 = Range(Range("Ark1!a1"), Range("ark1!a1").End(xlDown))
Me.combo_sedatoer.List = rng2.Value

The value in my range is date
And in the sheet the value is dd-mm-yyyy
But in the combobox the value are mm/dd/yyyy

I have try to use format "dd-mm-yyyy" but don't know where to do this
i get a error when i try
So maybe someone can help?

Alvin
 
G

Guest

Hi,

This solved it for me ( I use UK date formats):

Me.combo_sedatoer.rowsource = rng2.address
 
G

Guest

Hi topper
yes the right date comes
but when you choose a value
the value in the combobox become a number??

Alvin
 
G

Guest

Try:

Private Sub ComboBox1_Change()
ComboBox1.Value = Format(CDate(ComboBox1.Text), "dd-mm-yyyy")
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top