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.