Johnny Thunder
Well-known Member
- Joined
- Apr 9, 2010
- Messages
- 693
- Office Version
- 2016
- Platform
- MacOS
Hello All,
I have a report that has data in a Column based format (Left to right) that I need to convert into a linear format (up and down) and not sure that fastest way to accomplish this.
My data has column detail from Columns A:F, in in Columns G:AP there are ID's that I need to grab and create a duplicate of the row and enter each unique ID into column F. I did create a helper column in Column E that Counts how many values are in Columns G:AP.
Once the code runs it will clear all the values in columns G:AP since they have now been moved into Column F as unique rows.
Currently my report has 121 rows of data and for each row so will definitely need code to achieve this quickly.
Here is a mocked-up example of what I mean;
Current (I intentionally left columns B:E out of the grid for this example)
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Col A[/TD]
[TD]Col E[/TD]
[TD]Col F[/TD]
[TD]ID1[/TD]
[TD]ID2[/TD]
[TD]ID3[/TD]
[TD]ID4[/TD]
[/TR]
[TR]
[TD]Name1[/TD]
[TD]3[/TD]
[TD]Currently Blank[/TD]
[TD]J1[/TD]
[TD]J2[/TD]
[TD]J3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name2[/TD]
[TD]2[/TD]
[TD]Currently Blank[/TD]
[TD]Z5[/TD]
[TD]Z10[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Expectation
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Col A[/TD]
[TD]Col E[/TD]
[TD]Col F[/TD]
[TD]ID1[/TD]
[TD]ID2[/TD]
[TD]ID3[/TD]
[TD]ID4[/TD]
[/TR]
[TR]
[TD]Name 1[/TD]
[TD]3[/TD]
[TD]J1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name 1[/TD]
[TD]3[/TD]
[TD]J2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name 1[/TD]
[TD]3[/TD]
[TD]J3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name 2[/TD]
[TD]2[/TD]
[TD]Z5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name 2[/TD]
[TD]2[/TD]
[TD]Z10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Any help on this is appreciated.
I have a report that has data in a Column based format (Left to right) that I need to convert into a linear format (up and down) and not sure that fastest way to accomplish this.
My data has column detail from Columns A:F, in in Columns G:AP there are ID's that I need to grab and create a duplicate of the row and enter each unique ID into column F. I did create a helper column in Column E that Counts how many values are in Columns G:AP.
Once the code runs it will clear all the values in columns G:AP since they have now been moved into Column F as unique rows.
Currently my report has 121 rows of data and for each row so will definitely need code to achieve this quickly.
Here is a mocked-up example of what I mean;
Current (I intentionally left columns B:E out of the grid for this example)
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Col A[/TD]
[TD]Col E[/TD]
[TD]Col F[/TD]
[TD]ID1[/TD]
[TD]ID2[/TD]
[TD]ID3[/TD]
[TD]ID4[/TD]
[/TR]
[TR]
[TD]Name1[/TD]
[TD]3[/TD]
[TD]Currently Blank[/TD]
[TD]J1[/TD]
[TD]J2[/TD]
[TD]J3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name2[/TD]
[TD]2[/TD]
[TD]Currently Blank[/TD]
[TD]Z5[/TD]
[TD]Z10[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Expectation
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Col A[/TD]
[TD]Col E[/TD]
[TD]Col F[/TD]
[TD]ID1[/TD]
[TD]ID2[/TD]
[TD]ID3[/TD]
[TD]ID4[/TD]
[/TR]
[TR]
[TD]Name 1[/TD]
[TD]3[/TD]
[TD]J1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name 1[/TD]
[TD]3[/TD]
[TD]J2[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name 1[/TD]
[TD]3[/TD]
[TD]J3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name 2[/TD]
[TD]2[/TD]
[TD]Z5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name 2[/TD]
[TD]2[/TD]
[TD]Z10[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
Any help on this is appreciated.