Combo Box Formatting
You could also add the items to the combobox using .additem--and format the
dates anyway you want.
Option Explicit
Sub testme()
Dim myRng As Range
Dim myCell As Range
With Worksheets("Sheet1")
Set myRng = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp))
.ComboBox1.Clear
.ComboBox1.ListFillRange = "" 'just in case!
For Each myCell In myRng.Cells
'.ComboBox1.AddItem myCell.Text
.ComboBox1.AddItem Format(myCell.Value, "mmmm dd, yyyy")
Next myCell
End With
End Sub
You could use the .text property if the value in the cell was nicely
displayed--or format the date in an unambigous manner.
I'm not sure when you'd want to populate that combobox--when the workbook opens
(use auto_open or workbook_open) or when the worksheet is selected
(worksheet_activate event)????
Melissa wrote:
I set up a combo box using the control toolbox. The list is a list of dates,
however once a date is selected it comes back as the number format instead of
the date format. I have formatted the linked cells and the linked list to
show as date but that still hasnt worked.
How do I get this field formatted to show the date not the number?
--
Dave Peterson
|