TextAlign in List Box

K

kirkm

I have a multi column list box and it's row source assigned to a
worksheet. Three of the columns contain numbers which should be
right aligned, and three text, to be left aligned.

The TextAlign properties affects all columns.

Is there any way to achieve this? I can get the Worksheet
formatted perfectly but that's lost in the list box.

Any help much appreciated

Thanks - Kirk
 
K

kirkm

I'm answering my own question!

Just in case anyone's interested... or has an improvement.

Set TextAlign to 3. This fixes the numbers

For left alignment this works for me -

Function fixedlength(theString)
fixedlength = Left(theString & String$(10, 9), 10 + Len(theString))
End Function

ActiveWorkbook.Worksheets("Sheet1"t).Range("A1").Value =
LTrim(fixedlength("12345"))
 

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

Similar Threads


Top