I have a request for how I might go about the following operation:
I have a csv file (that I’m opening in Excel) that I am appending a block of data 50X2 (rowsXcolumns) to the csv file. With the finished csv file, I would like to automate a process where every 50 rows get selected (both columns) and the data essentially gets cut and copied to the next two available columns.
An example would be data from $A$1:$B$50 is in the csv and then a second sample is taken and the second set of data goes to $A$51:$B$100 and I would like to automatically move the second set to $C$1:$D$50 and perform that move for all samples taken.
I don’t know what the best route for this operation would be (macro/VBA/etc) and would like some assistance with this, if it is easily possible.
Thank you all for your time and help.
The basic idea behind what needs to be done is:
Total Rows/#rows per column)nth + 1row to the last row, wherenthrow is the number of rows per column that you want (in your case, 50).Here is some sample code that I put together to get you started. This assumes your data starts in cell A1, and that each column should contain a maxium of 10 rows. You can change the
rowsToSkipvalue to meet your needs. Also, please note that this is meant to get you started and requires more testing. Alter it as you see fit:What this does is it first finds out how many new columns to make, then it cuts from the 11th row in each column down to the last row, then pastes those values after the last column that contains data. It does this until all new columns have been made. Please note that this leaves 10 rows of data per column. To change this to 50 you just need to change the
rowsToSkipvariable to50.Here is the before and after screenshots:
BEFORE

AFTER
