VBA - Copy Each Columns Data in Row

unknownymous

Board Regular
Joined
Sep 19, 2017
Messages
249
Office Version
  1. 2016
Platform
  1. Windows
Hi Guys,

I have this data below but what i need is to produce the data in list form


Before:

[TABLE="width: 500"]
<tbody>[TR]
[TD]ID[/TD]
[TD]RANK[/TD]
[TD]NAME[/TD]
[TD]NOTE1[/TD]
[TD]NOTE2[/TD]
[TD]1/30/2018[/TD]
[TD]8/30/2017[/TD]
[TD]5/30/2017[/TD]
[TD]4/30/2017[/TD]
[TD]1/30/2017[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]01[/TD]
[TD]1[/TD]
[TD]Ben[/TD]
[TD][/TD]
[TD][/TD]
[TD]500[/TD]
[TD]450[/TD]
[TD]300[/TD]
[TD]250[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]02[/TD]
[TD]2[/TD]
[TD]Sam[/TD]
[TD][/TD]
[TD][/TD]
[TD]450[/TD]
[TD]425[/TD]
[TD]275[/TD]
[TD]225[/TD]
[TD]175[/TD]
[/TR]
[TR]
[TD]03[/TD]
[TD]3[/TD]
[TD]Max[/TD]
[TD][/TD]
[TD][/TD]
[TD]425[/TD]
[TD]400[/TD]
[TD]250[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Result: Will be exported in another sheet named "Results"

[TABLE="width: 500"]
<tbody>[TR]
[TD]Date[/TD]
[TD]Score[/TD]
[/TR]
[TR]
[TD]1/30/2018[/TD]
[TD]500[/TD]
[/TR]
[TR]
[TD]1/30/2018[/TD]
[TD]450[/TD]
[/TR]
[TR]
[TD]1/30/2018[/TD]
[TD]425[/TD]
[/TR]
[TR]
[TD]8/30/2017[/TD]
[TD]450[/TD]
[/TR]
[TR]
[TD]8/30/2017[/TD]
[TD]425[/TD]
[/TR]
[TR]
[TD]8/30/2017[/TD]
[TD]400[/TD]
[/TR]
[TR]
[TD]5/30/2017[/TD]
[TD]300[/TD]
[/TR]
[TR]
[TD]5/30/2017[/TD]
[TD]275[/TD]
[/TR]
[TR]
[TD]5/30/2017[/TD]
[TD]250[/TD]
[/TR]
[TR]
[TD]4/30/2017[/TD]
[TD]250[/TD]
[/TR]
[TR]
[TD]4/30/2017[/TD]
[TD]225[/TD]
[/TR]
[TR]
[TD]4/30/2017[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]1/30/2017[/TD]
[TD]200[/TD]
[/TR]
[TR]
[TD]1/30/2017[/TD]
[TD]175[/TD]
[/TR]
[TR]
[TD]1/30/2017[/TD]
[TD]150[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


Note that the data might be have additional dates and numbers might be more (set as until row 10K for each column). Lastly, all zero will be deleted.


Any help will be much appreciated.
 
Last edited:

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
something along the lines of

Dim c As Range, rng
Dim lr As Long

Set rng = Range("f2:j4")
For Each c In rng
lr = Range("o" & Rows.Count).End(xlUp).Row + 1
Range("o" & lr) = c.Value
Range("n" & lr) = Cells(1, c.Column).Value
Next c
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top