Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
BG BG is offline
external usenet poster
 
Posts: 31
Default Reformatting data for a listbox

I'm filling a listbox on a userform with an array linked to a Range and the
data displays in long decimal format. I want it displayed to only two decimal
places.

The Range itself display correctly, but the cells contain formulas, not
values.

The "numberformat" property doen't seem to apply to arrays or listboxes. Is
there a method I can use to properly display the data in the listbox without
going through the step of recopying/formatting the Range as values and then
filling the array (and subsequently the list box)?

This is a fake example but it gets the point across:
- Range("a1") =(some big honking formula that = 2.009873654) but displays
as "2"
- MyArray (0,0) = Range("a1")
- Listbox1.list = MyArray (and displays as 2.009873654...)
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 272
Default Reformatting data for a listbox

Try MyArray(0,0) = Format(Range("A1"),"0.##")
--
Charles Chickering

"A good example is twice the value of good advice."


"BG" wrote:

I'm filling a listbox on a userform with an array linked to a Range and the
data displays in long decimal format. I want it displayed to only two decimal
places.

The Range itself display correctly, but the cells contain formulas, not
values.

The "numberformat" property doen't seem to apply to arrays or listboxes. Is
there a method I can use to properly display the data in the listbox without
going through the step of recopying/formatting the Range as values and then
filling the array (and subsequently the list box)?

This is a fake example but it gets the point across:
- Range("a1") =(some big honking formula that = 2.009873654) but displays
as "2"
- MyArray (0,0) = Range("a1")
- Listbox1.list = MyArray (and displays as 2.009873654...)

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
Reformatting data Rick Excel Worksheet Functions 3 October 22nd 09 04:25 AM
reformatting input data field888 Excel Discussion (Misc queries) 0 April 16th 09 08:16 PM
Reformatting data and consolidating lcotner Excel Worksheet Functions 2 April 17th 08 07:40 PM
Data Formatting/Reformatting TimR Excel Discussion (Misc queries) 0 December 21st 05 04:14 PM
reformatting data Jeff Gilstrap Excel Programming 2 August 4th 04 06:03 AM


All times are GMT +1. The time now is 06:21 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"