Hello.
I've been going through fora, but haven't found a satisfactory answer.
I have multiple column pairs (>80) of date/time-value data. Unfortunately the first date/time values are all of different beginnings. So one starts at noon, the other next pair starts at 12:05 etc. All have the same time interval.
The basic structure is:
Col.A Col.B Col.C Col.D ... ... Col.X Col.Y ...
R2 D-T Data D-T Data ... ...
R4 12:00 Val 12:15 Val ... ... 12:03 Val ... etc.
I know that I can manually sort this thing out, but it would take me ages to align and sort out. I was hoping to have a macro do the dirty job. I'm not very good at VBA, but a pseudocode that I have in mind could go:
1. scan the first line of date/time columns and find the earliest date/time value;
2. copy this column and column+1 to another worksheet in the next vacant column(s);
3. align the latest copied columns with the column-2 date/time (ie blank cells will be generated above this newly pasted data to match dates and times on the same row; data values move along with their respective date/times)
4. goto 1 until no columns are left in the original worksheet;
The number of pairs is known, as I use this in another macro for a for-loop. This value resides in A1 in the original worksheet.
R2 and R4 above are row2 and row4 respectively, D-T stands for date and time, formatted as dd/mm/yyyy hh:mm:ss
Thanks for any feedback provided.
I've been going through fora, but haven't found a satisfactory answer.
I have multiple column pairs (>80) of date/time-value data. Unfortunately the first date/time values are all of different beginnings. So one starts at noon, the other next pair starts at 12:05 etc. All have the same time interval.
The basic structure is:
Col.A Col.B Col.C Col.D ... ... Col.X Col.Y ...
R2 D-T Data D-T Data ... ...
R4 12:00 Val 12:15 Val ... ... 12:03 Val ... etc.
I know that I can manually sort this thing out, but it would take me ages to align and sort out. I was hoping to have a macro do the dirty job. I'm not very good at VBA, but a pseudocode that I have in mind could go:
1. scan the first line of date/time columns and find the earliest date/time value;
2. copy this column and column+1 to another worksheet in the next vacant column(s);
3. align the latest copied columns with the column-2 date/time (ie blank cells will be generated above this newly pasted data to match dates and times on the same row; data values move along with their respective date/times)
4. goto 1 until no columns are left in the original worksheet;
The number of pairs is known, as I use this in another macro for a for-loop. This value resides in A1 in the original worksheet.
R2 and R4 above are row2 and row4 respectively, D-T stands for date and time, formatted as dd/mm/yyyy hh:mm:ss
Thanks for any feedback provided.