Ive tried to add the contents of a Row of cells "B3:F3" from a sheet 'TOTALS' to a drop down box using the below code, the sheets cells contain dates formatted as Dates.
The output should look like this :
01-09-15
02-09-15
03-09-15
04-09-15
05-09-15
Private Sub UserForm_Initialize()
Dim i As Integer
Worksheets("TOTALS").Select
ListBox1.List = Application.Transpose(Range("B3:F3"))
For i = 0 To ListBox1.ListCount - 1
ListBox1.List(i) = Format(Val(ListBox1.Text), "dd-mm-yy")
Next i
End Sub
When i use the code the output is:
30-12-99
30-12-99
30-12-99
30-12-99
30-12-99
Ive also tried to use 'CDate' instead of 'Val' but i get a run time error. Any ideas on where i might be going wrong?
Bookmarks