Two options :
- Stay as it is with your calculations to create each necessary worksheet and with my post #7 procedure to save each worksheet to a text file.
- Do all at once within a single VBA procedure.
For the last one, I may help only with a complete crystal clear elaboration - so with all the necessary in order there is nothing to guess - of each step …
I've posted various threads for each of the task to be carried out in preparing those sheets and they've been answered. So I think I can go with option 1. However, I will still go ahead to elaborate, maybe option 2 could come out. But if my elaboration still seem unclear, then option 1 would be the only option to opt into.
The source csv text file has a single worksheet that contains 2 columns of latitudes and longitudes. Let's assume the number of these data (rows) is 100. The following tasks are to be performed on that single sheet of the source csv file.
1. Make copies of the single worksheet 98 times to make all number of worksheets to become 99 including the original worksheet (that is, numbers of worksheet equals number of rows minus one).
2. While worksheet 1 (original worksheet) remains untouched; delete row 1 in worksheet 2; delete row 1 and row 2 in worksheet 3; delete row 1, row 2, row 3 in worksheet 4; delete row 1, row2, row3, row4 in worksheet 5, this sequence of deletion goes on to last worksheet (worksheet 99).
3. Starting from the 2nd row of each worksheet, insert blank rows after every other row. That is after row 1 and row 2, a blank row should be inserted. Then after row 3, insert another blank row. After row 4, insert another blank row and so on. The idea is that this "insertion of blank row after every other row" must start after row 2, and this should process across all worksheets.
3. Fill in the blank rows with the values in each of their first row. That is values in A1:B1. For instance, the two column values in row 1 of worksheet 1 should be used to fill in all blank rows in worksheet 1. The two column values in row 1 of worksheet 2 should be used to fill in all blank rows in worksheet 2 and so on for all the worksheets.
4. Save these file with all these multiple worksheets for record purpose.
5. Separate all worksheets to be individually saved as csv text file. (This task 5 is the purpose of this present thread).