Hello all, I am looking for some guidance for performing a loop to essentially concatenate data from a range of cells into an output file. I have written code that writes (exports) a *.txt file for all data entered into worksheet. Each row of data is a separate check payment to various vendors so the data is very simple: Name, address, check amount, and data from the invoice. The limitation with what I've built is each row is a single payment record and the macro writes each row into the *.txt file in the same order it was input into the worksheet.
I want to expand the use of this worksheet to provide the users of this worksheet to add multiple invoices to a single payment. Functionally, the user just adds the necessary data in the corresponding columns for the data they are adding while leaving the other fields (i.e. name, address, amount) blank. If I use check number as the key field that links the records together, how can I perform a loop for to count the number of times the check number field is the same so I can use the loop to concatenate the data fields and then move on to the next payment. Each payment can have 0 additional records or up to 2400 (unlikely but that is the system max).
I want to expand the use of this worksheet to provide the users of this worksheet to add multiple invoices to a single payment. Functionally, the user just adds the necessary data in the corresponding columns for the data they are adding while leaving the other fields (i.e. name, address, amount) blank. If I use check number as the key field that links the records together, how can I perform a loop for to count the number of times the check number field is the same so I can use the loop to concatenate the data fields and then move on to the next payment. Each payment can have 0 additional records or up to 2400 (unlikely but that is the system max).
I have a constraint that all this data must be concatenated in the output file.
I cannot seem to identify how many additional records are present for a given payment. I plan to use this variable amount in the .offset( ) to get the correct cell reference. Thanks in advance for your consideration.
I cannot seem to identify how many additional records are present for a given payment. I plan to use this variable amount in the .offset( ) to get the correct cell reference. Thanks in advance for your consideration.