first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Right-Justifying Text with the Format$() Function; Building Text Files with Fixed-Width Columns

In many financial applications text files are sometimes needed for automated input of data. Some data feeds are text files containing fixed-width columns. Oftentimes these columns are right-justified with the form:

XXX123
X12345
XXX234

where the X's are spaces forming a six-character, fixed-width column. If you are building this column from data in a database you will have to "pad" leading spaces. For our six-character column we can use the Format$() function:

VBA.Format$(strData, "@@@@@@")

where strData contains the data from the database.

mod date: 1999-05-19T03:16:26.000Z