Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Reformatting data | Excel Worksheet Functions | |||
reformatting input data | Excel Discussion (Misc queries) | |||
Reformatting data and consolidating | Excel Worksheet Functions | |||
Data Formatting/Reformatting | Excel Discussion (Misc queries) | |||
reformatting data | Excel Programming |