multicolumn Listbox and textalignment

  • Thread starter Thread starter Chip Pearson
  • Start date Start date
C

Chip Pearson

John,

I don't believe it is possible to change the alignments of individual
columns of a listbox.
 
Would there be a way to independently assign textalignments to different
columns in a multicolumn Listbox on a Userform ? Thanks,
JH
 
Hi John,
i had that feeling. For an application in which i need to right align a
currency and in the same list have other columns align left, i need some
kind of tric. i tried formatting the column in the Excel-sheet itself in a
variety of ways, but i cannot get it as it should. I was thinking of having
the currency formats read into a textstring with a certain length and lead
them with enough blanks to have them aligned right as well. Do you think
that would work, or would i have a better chance by filling the Listbox
using an array in stead of using the Cellrange of a sheet ? Thanks for any
comments,

An alternative would be to use the common ListView control instead of the
built-in ListBox. It's a little harder to code against, but gives much more
functionality (including alignment of individual columns). You can add it by
right-clicking the control toolbox, choosing 'Additional controls' and
selecting the 'Microsoft List View control'.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk
 
thanks for your suggestion Stephen, i have not tried it yet, because in the
meantime i have been able to accomplish what i wanted by adjusting the
formatting of the input data. it required some trial and error, but finally
managed to have a currency align on the right in a Listbox, while the
original and all other columns are outlined on the left,
thanks again,
JH
 
Back
Top