PC Review


Reply
Thread Tools Rate Thread

changing format of a column in a listbox

 
 
=?Utf-8?B?RGFsZSBGeWU=?=
Guest
Posts: n/a
 
      12th Oct 2007
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.
 
Reply With Quote
 
 
 
 
Leith Ross
Guest
Posts: n/a
 
      12th Oct 2007
On Oct 12, 11:11 am, Dale Fye <dale....@nospam.com> 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 With Quote
 
=?Utf-8?B?RGFsZSBGeWU=?=
Guest
Posts: n/a
 
      15th Oct 2007
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 <dale....@nospam.com> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Column Heads in Listbox YorkieU Microsoft Access Form Coding 5 15th Oct 2009 05:07 PM
Format a ListBox column =?Utf-8?B?ZG9uYm93eWVy?= Microsoft Excel Programming 5 18th Mar 2007 06:20 PM
Re: Format Single Column in a Listbox Wayne Morgan Microsoft Access Forms 1 22nd Sep 2004 06:43 PM
How to Format a ListBox column Don Bowyer Microsoft Excel Programming 4 22nd Apr 2004 07:13 PM
Format listbox column for currency Nick Mirro Microsoft Access Getting Started 6 19th Oct 2003 05:38 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:33 PM.