ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Numbers aligning in a table (https://www.excelbanter.com/excel-discussion-misc-queries/240449-numbers-aligning-table.html)

Basharat A. Javaid

Numbers aligning in a table
 
Hi folks:

First of all, is there a feature in VB like the "PrintUsing ...." function
was in Basic?

I am trying to create & print strings made up of mostly dates & numbers of
various lengths by first converting them to text with the Text function. For
example, I have,

For report 1:
LineString1 = Birthdate$ &" "& HireDate$ &" "& TerminationDate$.....,
Wages$ &" "& Hours$" where

For report 2:
LineString2 = Age1$ &" "& Age2$ &" "& Service1$ & " "& Service2$ &" "&
Value1$.... &ValueN$ - all numbers.

where
yyyy$ etc are dates/numbers converted to text.

I am using the "Times New Roman" font size 10.
LineString1 prints OK for all records if there is no missing dates. But some
records may not have "termination date" and for those records the lines does
not align with the records which have "term dates" even though I insert
extra blanks equal to the length of the missing date which is in the
MM/DD/YY format.

I got LineString2 to print Ok for all records if all of the numbers are less
than a million (i.e. < or = 999,999). But if any of the numbers for a
record is a million or more, the lines will not align.

I could resolve this by using the "Courier New" font but the print comes out
lighter than the print in New Roman so I would like to stick with the New
Roman font.

Any suggestions on solving this problem would be appreciated (without
changing the font).

A thought just occurred to me - I could solve this if I knew how many blank
spaces in Time New Roman font would take up the space taken up by:
the forward slash (/), the comma (,) the dollar sign ($) and the
numbers 0 to 9.

I could figure this out by trial and error but does anyone know the spacing
equivalents?

Thanks.


--
Basharat Javaid.




All times are GMT +1. The time now is 06:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com