Help coding Excel Macro

namariegaudi

New Member
Joined
Oct 14, 2016
Messages
14
Hi. I'm not a programmer and need help for a local company I'm working with. I have a spreadsheet that has a fixed number of columns (number of rows changes), BUT the dates on those columns can vary. I need to transpose the data and copy the company for as many dates it has listed. There's a second caveat, there's a status columns that groups the data all in one field. I need to have the field separated (the assumption, is that each status answer belongs to a date (in chronological order to the dates listed). So in a nutshell I have:
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Calibri; color: #ffffff}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; text-align: center; font: 11.0px Calibri; color: #ffffff}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Calibri Light'}p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; text-align: right; font: 11.0px 'Calibri Light'}p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Calibri Light'; min-height: 13.0px}p.p6 {margin: 0.0px 0.0px 0.0px 0.0px; text-align: right; font: 11.0px 'Calibri Light'; min-height: 13.0px}table.t1 {border-collapse: collapse}td.td1 {background-color: #38d4d6; border-style: solid; border-width: 0.8px 1.0px 0.8px 0.8px; border-color: #a8d6ff #cbcbcb #a8d6ff #a8d6ff; padding: 0.0px 5.0px 0.0px 5.0px}td.td2 {background-color: #38d4d6; border-style: solid; border-width: 0.8px 1.0px 0.8px 1.0px; border-color: #a8d6ff #cbcbcb #a8d6ff #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px}td.td3 {background-color: #d4feff; border-style: solid; border-width: 0.8px 1.0px 0.8px 0.8px; border-color: #a8d6ff #cbcbcb #a8d6ff #a8d6ff; padding: 0.0px 5.0px 0.0px 5.0px}td.td4 {background-color: #d4feff; border-style: solid; border-width: 0.8px 1.0px 0.8px 1.0px; border-color: #a8d6ff #cbcbcb #a8d6ff #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px}td.td5 {border-style: solid; border-width: 0.8px 1.0px 0.8px 0.8px; border-color: #a8d6ff #cbcbcb #a8d6ff #a8d6ff; padding: 0.0px 5.0px 0.0px 5.0px}td.td6 {border-style: solid; border-width: 0.8px 1.0px 0.8px 1.0px; border-color: #a8d6ff #cbcbcb #a8d6ff #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px}</style>[TABLE="class: t1"]
<tbody>[TR]
[TD="class: td1"]Customer
[/TD]
[TD="class: td2"]Status
[/TD]
[TD="class: td2"]Fecha_Real_01
[/TD]
[TD="class: td2"]Fecha_Real_02
[/TD]
[TD="class: td2"]Fecha_Real_03
[/TD]
[TD="class: td2"]Fecha_Real_04
[/TD]
[TD="class: td2"]Fecha_Real_05
[/TD]
[TD="class: td2"]Fecha_Real_06
[/TD]
[TD="class: td2"]Fecha_Real_07
[/TD]
[TD="class: td2"]Fecha_Real_08
[/TD]
[TD="class: td2"]Fecha_Real_09
[/TD]
[TD="class: td2"]Fecha_Real_10
[/TD]
[TD="class: td2"]Fecha_Real_11
[/TD]
[TD="class: td2"]Fecha_Real_12
[/TD]
[TD="class: td2"]Fecha_Real_13
[/TD]
[TD="class: td2"]Fecha_Real_14
[/TD]
[TD="class: td2"]Fecha_Real_15
[/TD]
[/TR]
[TR]
[TD="class: td3"]Serviacero Worthington
[/TD]
[TD="class: td4"]Si;#Si;#Si
[/TD]
[TD="class: td4"]5/1/18
[/TD]
[TD="class: td4"]9/1/18
[/TD]
[TD="class: td4"]14/3/18
[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[/TR]
[TR]
[TD="class: td5"]Aceros y Prensas
[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[/TR]
[TR]
[TD="class: td3, colspan: 2"]STEEL TECHNOLOGIES DEMEXICO, S.A.
[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[/TR]
[TR]
[TD="class: td5"]De Acero
[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[/TR]
[TR]
[TD="class: td3"]ACEROS DEL TORO, SA DE CV
[/TD]
[TD="class: td4"]Si;#Si;#Si;#Si;#Si;#Si
[/TD]
[TD="class: td4"]9/1/18
[/TD]
[TD="class: td4"]23/1/18
[/TD]
[TD="class: td4"]1/3/18
[/TD]
[TD="class: td4"]9/3/18
[/TD]
[TD="class: td4"]14/3/18
[/TD]
[TD="class: td4"]22/3/18
[/TD]
[TD="class: td4"]13/4/18
[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[/TR]
[TR]
[TD="class: td5"]Coalición Acerera
[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[/TR]
[TR]
[TD="class: td3"]Proacero
[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[TD="class: td4"]

[/TD]
[/TR]
[TR]
[TD="class: td5"]Aceros Galacticos
[/TD]
[TD="class: td5"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[TD="class: td6"]

[/TD]
[/TR]
</tbody>[/TABLE]
And need something like this:
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Calibri; color: #ffffff}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px 'Calibri Light'}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; text-align: right; font: 11.0px Calibri}p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Calibri}p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; text-align: right; font: 11.0px Calibri; min-height: 13.0px}table.t1 {border-collapse: collapse}td.td1 {background-color: #38d4d6; border-style: solid; border-width: 0.8px 1.0px 0.8px 0.8px; border-color: #a8d6ff #cbcbcb #a8d6ff #a8d6ff; padding: 0.0px 5.0px 0.0px 5.0px}td.td2 {background-color: #38d4d6; border-style: solid; border-width: 0.8px 1.0px 0.8px 1.0px; border-color: #a8d6ff #cbcbcb #a8d6ff #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px}td.td3 {background-color: #38d4d6; border-style: solid; border-width: 0.8px 0.8px 0.8px 1.0px; border-color: #a8d6ff #a8d6ff #a8d6ff #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px}td.td4 {background-color: #d4feff; border-style: solid; border-width: 0.8px 1.0px 0.8px 0.8px; border-color: #a8d6ff #cbcbcb #a8d6ff #a8d6ff; padding: 0.0px 5.0px 0.0px 5.0px}td.td5 {background-color: #d4feff; border-style: solid; border-width: 0.8px 1.0px 0.8px 1.0px; border-color: #a8d6ff #cbcbcb #a8d6ff #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px}td.td6 {background-color: #d4feff; border-style: solid; border-width: 0.8px 0.8px 0.8px 1.0px; border-color: #a8d6ff #a8d6ff #a8d6ff #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px}td.td7 {border-style: solid; border-width: 0.8px 1.0px 0.8px 0.8px; border-color: #a8d6ff #cbcbcb #a8d6ff #a8d6ff; padding: 0.0px 5.0px 0.0px 5.0px}td.td8 {border-style: solid; border-width: 0.8px 1.0px 0.8px 1.0px; border-color: #a8d6ff #cbcbcb #a8d6ff #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px}td.td9 {border-style: solid; border-width: 0.8px 0.8px 0.8px 1.0px; border-color: #a8d6ff #a8d6ff #a8d6ff #cbcbcb; padding: 0.0px 5.0px 0.0px 5.0px}</style>[TABLE="class: t1"]
<tbody>[TR]
[TD="class: td1"]Customer
[/TD]
[TD="class: td2"]Date
[/TD]
[TD="class: td3"]Status
[/TD]
[/TR]
[TR]
[TD="class: td4"]Serviacero Worthington
[/TD]
[TD="class: td5"]5/1/18
[/TD]
[TD="class: td6"]Si
[/TD]
[/TR]
[TR]
[TD="class: td7"]Serviacero Worthington
[/TD]
[TD="class: td8"]9/1/18
[/TD]
[TD="class: td9"]Si
[/TD]
[/TR]
[TR]
[TD="class: td4"]Serviacero Worthington
[/TD]
[TD="class: td5"]14/3/18
[/TD]
[TD="class: td6"]Si
[/TD]
[/TR]
[TR]
[TD="class: td7"]Aceros y Prensas
[/TD]
[TD="class: td8"]

[/TD]
[TD="class: td9"]

[/TD]
[/TR]
[TR]
[TD="class: td4, colspan: 2"]STEEL TECHNOLOGIES DEMEXICO, S.A.
[/TD]
[TD="class: td6"]

[/TD]
[/TR]
[TR]
[TD="class: td7"]De Acero
[/TD]
[TD="class: td8"]

[/TD]
[TD="class: td9"]

[/TD]
[/TR]
[TR]
[TD="class: td4"]ACEROS DEL TORO, SA DE CV
[/TD]
[TD="class: td5"]9/1/18
[/TD]
[TD="class: td6"]Si
[/TD]
[/TR]
[TR]
[TD="class: td7"]ACEROS DEL TORO, SA DE CV
[/TD]
[TD="class: td8"]23/1/18
[/TD]
[TD="class: td9"]Si
[/TD]
[/TR]
[TR]
[TD="class: td4"]ACEROS DEL TORO, SA DE CV
[/TD]
[TD="class: td5"]1/3/18
[/TD]
[TD="class: td6"]Si
[/TD]
[/TR]
[TR]
[TD="class: td7"]ACEROS DEL TORO, SA DE CV
[/TD]
[TD="class: td8"]9/3/18
[/TD]
[TD="class: td9"]Si
[/TD]
[/TR]
[TR]
[TD="class: td4"]ACEROS DEL TORO, SA DE CV
[/TD]
[TD="class: td5"]14/3/18
[/TD]
[TD="class: td6"]Si
[/TD]
[/TR]
[TR]
[TD="class: td7"]ACEROS DEL TORO, SA DE CV
[/TD]
[TD="class: td8"]22/3/18
[/TD]
[TD="class: td9"]Si
[/TD]
[/TR]
[TR]
[TD="class: td4"]ACEROS DEL TORO, SA DE CV
[/TD]
[TD="class: td5"]13/4/18
[/TD]
[TD="class: td6"]

[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi, Need some help with a similar macro but this time I need to bring more data. The rows vary in "products" entered from 1 or up to 5. need to bring the data as many times as I have products per row. is there a way I can send you a copy of the data and the fields I need?
 
Upvote 0
As this is a new question, could you please start a new thread
Thanks
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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