Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Populating list box with number format data

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
--
Regards and Thanks for any assistance.

Francis Brown.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Populating list box with number format data


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

--
Leith Ros
-----------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846
View this thread: http://www.excelforum.com/showthread.php?threadid=49291

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Populating list box with number format data

try

..additem format(cell.value, "hh:mm:ss")
or
..additem cell.text

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Francis Brown wrote :

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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 575
Default Populating list box with number format data

Francis,

Have a look at the format function.

It will be something like

..AddItem format(cell.Value, "hh:mm:ss")

Robin Hammond
www.enhanceddatasystems.com

"Francis Brown" wrote in message
...
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
--
Regards and Thanks for any assistance.

Francis Brown.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populating a data validation list based on criteria Ciarán Excel Discussion (Misc queries) 3 February 27th 09 08:03 AM
Custom Number Format List JKinAK Excel Discussion (Misc queries) 2 October 9th 08 01:02 AM
.AddItem list and populating combobox with created list pallaver Excel Discussion (Misc queries) 8 June 27th 08 12:36 PM
Populating a Data Validation List Jim Skrydlak Excel Discussion (Misc queries) 2 September 7th 07 12:00 AM
Populating dropdown list 2 with data depending upon what was selected in list 1 karambos Excel Programming 2 November 9th 04 05:32 PM


All times are GMT +1. The time now is 03:59 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"