I have been trying to figure this one out for some time and have not done anything VBA related in many years. So basically, I would consider myself new to it at this point. Below is what I am attempting to do. PLEASE HELP!!!
I have an Excel document that contains about 25 rows of data and 10 columns (rows/records will change over time, so need to create a loop that reads to the end of the file). For each line/record/row, I need to output/write to a fixed text file that will be uploaded to another application. Unfortunately, the "fixed" format requires very specific start and end positions (or lengths) for each field. Additionally, each Excel row requires being broken out into 3 lines. Please see the example below.
Excel Data:
Field 1 Field 2 Field 3 Field 4 Field 5 Field 6 Field 7
7-06-1999 Hudson Inc 60 Collected 273.95 #123456 Received on 05/02/2005
10-14-2012 Compton LLP 90 Paid 1304.75 #457312 Received on 05/02/2017
09-30-2014 YHN LLC 180 Billed 375.91 #90875 Past Due bill
06-12-1999 Oakley Corp 60 Collected 108.25 #3879487 Outstanding balance remains to be collected in August
12-25-2000 A&F Corp 30 Collected 45.34 #02375-E Always pays on time
*************************************************************************************************************************
NOW, I need the text file to look like the following for each record (below shows the 1st and last records from the table above). Each field from above has a specified start position and line number as shown below (ex. Date is always line 1 position 1 and 10 characters length, Invoice # is always line 2 position 35 and can be up to 20 char).
7-06-1999
Hudson Inc 60 Collected
273.85 #123456 Received on 05/02/2005
12-25-2000
A&F Corp 90 Paid
45.34 #02375-E Always pays on time
Thanks!!!
Bookmarks