Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default changing format of a column in a listbox

I have a column in a listbox that should have a variety of datatypes in it
(text, numeric, numeric formatted a percent) which is being pulled from a
column in another worksheet. Unfortunately, when the data is pulled in:

me.lst_mylist.list(rowPointer, 4) = mySheet.Cells(somevalue, 5)

the values that are formatted as percentages in MySheet, are getting
converted to a decimal value in the list. Anybody have any idea how to
format the values from MySheet so that they appear properly in the list?

Text values should appear as text
values that are formatted as percent should show up that way
other numbers should show up that way

If I go into MySheet and manually insert an apostrophe before the items
formated as percent, they show up properly in the listbox, put if I
concatenate the apostrophe to the value they all show up as 'Yes, or '1
instead of 100%.

Dale
--
Email address is not valid.
Please reply to newsgroup only.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 128
Default changing format of a column in a listbox

On Oct 12, 11:11 am, Dale Fye wrote:
I have a column in a listbox that should have a variety of datatypes in it
(text, numeric, numeric formatted a percent) which is being pulled from a
column in another worksheet. Unfortunately, when the data is pulled in:

me.lst_mylist.list(rowPointer, 4) = mySheet.Cells(somevalue, 5)

the values that are formatted as percentages in MySheet, are getting
converted to a decimal value in the list. Anybody have any idea how to
format the values from MySheet so that they appear properly in the list?

Text values should appear as text
values that are formatted as percent should show up that way
other numbers should show up that way

If I go into MySheet and manually insert an apostrophe before the items
formated as percent, they show up properly in the listbox, put if I
concatenate the apostrophe to the value they all show up as 'Yes, or '1
instead of 100%.

Dale
--
Email address is not valid.
Please reply to newsgroup only.


Hello Dale,

Everything that is loaded into a ListBox is String Data. Worksheet
cell values are by default variant. If you want to load the ListBox
with what appears in the cell then you need to use the TEXT property
of the cell.

me.lst_mylist.list(rowPointer, 4) = mySheet.Cells(somevalue,
5).Text

Sincerely,
Leith Ross

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default changing format of a column in a listbox

Thanks.

That did the job.
--
Email address is not valid.
Please reply to newsgroup only.


"Leith Ross" wrote:

On Oct 12, 11:11 am, Dale Fye wrote:
I have a column in a listbox that should have a variety of datatypes in it
(text, numeric, numeric formatted a percent) which is being pulled from a
column in another worksheet. Unfortunately, when the data is pulled in:

me.lst_mylist.list(rowPointer, 4) = mySheet.Cells(somevalue, 5)

the values that are formatted as percentages in MySheet, are getting
converted to a decimal value in the list. Anybody have any idea how to
format the values from MySheet so that they appear properly in the list?

Text values should appear as text
values that are formatted as percent should show up that way
other numbers should show up that way

If I go into MySheet and manually insert an apostrophe before the items
formated as percent, they show up properly in the listbox, put if I
concatenate the apostrophe to the value they all show up as 'Yes, or '1
instead of 100%.

Dale
--
Email address is not valid.
Please reply to newsgroup only.


Hello Dale,

Everything that is loaded into a ListBox is String Data. Worksheet
cell values are by default variant. If you want to load the ListBox
with what appears in the cell then you need to use the TEXT property
of the cell.

me.lst_mylist.list(rowPointer, 4) = mySheet.Cells(somevalue,
5).Text

Sincerely,
Leith Ross


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
Excel 2000 Column Format not changing. Mic Excel Discussion (Misc queries) 1 June 12th 07 12:27 AM
Changing the format of a column MEAD5432 Excel Discussion (Misc queries) 2 May 15th 07 06:11 PM
Format a ListBox column donbowyer Excel Programming 5 March 18th 07 06:20 PM
Changing format of column from "general" to "currency" Old Car Excel Discussion (Misc queries) 1 April 29th 05 09:49 AM
How to Format a ListBox column Don Bowyer Excel Programming 4 April 22nd 04 07:13 PM


All times are GMT +1. The time now is 12:23 AM.

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

About Us

"It's about Microsoft Excel"