Populating list box with number format data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The following snipet of code populates a list box with time data from the
defined range.

On the cells in the originating worksheet the data is defined as hh:mm:ss as
the number format.

However when the list box displays it displays as 0.33476... etc

Can some one show me how to display as hh:mm:ss in the list box.

With Simple.ListBox5
.RowSource = ""
For Each cell In Cells(2, NextCol).resize(LastRow - 1, 1)
.AddItem cell.Value
Next cell

End With
 
Hello Francis,

To load the ListBox with the data as it appears in the cell, change

.AddItem cell.value

To

.AddItem cell.text

Sincerely,
Leith Ros
 

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

Similar Threads

Formatting values populated by VB Code 3
Populating a List Box 1
AdvancedFilter 4
Populate Combo Box 6
combo box 2
Run two macros for two different sheets 11
Formatting short times 2
Populate combobox 6

Back
Top