Reformatting data for a listbox

G

Guest

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...)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top