Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default How to align decimals in a Listbox

1. You need to format the numbers into a string and then put them onto to the
list box. ie:

s = Format(1.22223, "#,##0.00")
You may then need to pad the left had side and there are always problems
with bigger numbers.

For the text you need to pad it with spaces. (ie check the length with len()
and then add spaces in the right hand side.


2. As seen in the format function you can use the same formats as the cells.

--
Hope this helps
Martin Fishlock, www.nyfconsultants.com, Bangkok, Thailand
Please do not forget to rate this reply.


" wrote:

I would like to have a column in a list box that contains numbers with
decimals and have the decimals aligned. Another column has text that
should be left aligned. Is there ANY way to do this.

A similar question: Can I apply the format of the cells in the worksheet to
the "same" "cells" in the list box? (If the contents of cell A6 is
displayed in a listbox, I would like the format of cell A6 to be used.)

Many thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
align left and right in listbox Dennis Excel Programming 2 September 14th 07 03:14 PM
How do I align decimals in Excel when not all numbers have % sym. sjgiles Excel Discussion (Misc queries) 2 September 7th 06 10:36 PM
Accounting format does not align decimals. Accounting Alignment Excel Discussion (Misc queries) 1 July 7th 06 08:42 PM
Can I right-align numbers in a Excel's VBA listbox Stefano Gatto Excel Programming 0 May 9th 06 08:44 PM
How to align decimals and limit number of sig fig's displayed MrShorty[_21_] Excel Programming 0 October 4th 05 07:26 PM


All times are GMT +1. The time now is 05:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"