How does one get numbers to display in a listbox that are lined up with the decimal place
The following is NOT what it should look like.
123.45
23.45
11223.45
Thanks,
John
How does one get numbers to display in a listbox that are lined up with the decimal place
The following is NOT what it should look like.
123.45
23.45
11223.45
Thanks,
John

This month, every Windows Secrets subscriber can download a one-chapter excerpt of Windows 7: The Missing Manual.Windows 7: The Missing Manual provides valuable information to help you overcome these difficulties in learning a new operating system. Subscribe today to download your free excerpt.
A listbox from the controls toolbar can be told to align right with its textalign property.
Jan Karel Pieterse
Microsoft Excel MVP, WMVP
www.jkp-ads.com
Professional Office Developers Association
Jan,
The listbox is generated within a UserForm and not the controls toolbar. I did not see a textalign property within the UserForm's listbox.
John
I see it in my version of XL97 SR2.
Do you have the "Properties Window" open? (F4 or View - Properties window)
or you can do it via VB (change list bax name as appropriate):
ListBox1.TextAlign = fmTextAlignRight
Steve
In the VB Editor window, if you don't have a properties box displayed, then right click in the listbox and click on Properties in the pop up menu. The properties window should appear with one of the properties being TextAlign.
Legare Coleman
Steve,
It must be Monday all over again. I can't seem to locate the TextAlign property. If I try changing the property via code an error message is returned: "object does not support this property or method".
John
How about this?
Steve
Steve,
One would only think it was that simple. This is what I have.
Are you sure that you have XL97 SR2? I have SR1 and like you, I have no TextAlign property. -- Sam
<font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
<small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>
Sam,
I definitely have XL97:SR2.
John
Steve, this is strange. I have Excel 97 SR2 (Dutch), and just like JStevens and SammyB, I don't see the TextAlign property for a list box. If I look up TextAlign in the online help, Applies To says that TextAlign is a property of a ComboBox, Label and TextBox. No mention of a ListBox. The Object Browser doesn't list TextAlign as a property of a ListBox either...
I responded at work where I have
Excel 97 SR-2 (l): I think it is an "el" in the parentheses. The font has a cap on the 1 in the dialog box. This has TextAlign.
I checked at home where I have:
Excel 97 SR-2: there is no "(l)". I don't know what difference the "sub-version" is. At home I did discover that I have NO TextAlign.
So this "later" revision might have the "addition".
Also, I don't know if there is any difference between VB references. At work I get what they install: (MS097.dll, FM20.dll, stdole2.tlb, excel8.olb, and VBA332.dll).
I can't compare at home until after work to see if any are different.
Steve
Just to confirm Hans, I upgraded last night to 97 SR2. I still do not have a text align property for a listbox, but I do have it for a combobox. I guess you'll have to use a combobox. --Sam
<font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
<small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>