TextAlign in List Box

  • Thread starter Thread starter kirkm
  • Start date Start date
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
 
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"))
 
Back
Top