View Single Post
  #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...)