Changing the layout of an Excel 2010 SAP report

Anita Kay

New Member
Joined
Jan 26, 2017
Messages
8
Hello all,

I have been coming the archives of many forums trying to find a good, effective and safe solution for changing the layout of an SAP report exported to Excel 2010. It takes months and months to get them to provide us with information and while we have asked for raw data they seem hesitant to give it to us. They always want to provide us with a report. I am not proficient with VBA but can get around. I do not understand a lot about looping.

What I need to do it to take the spreadsheet and insert twelve rows after each existing record, copy the information from columns A:L into the blanks beneath each populated row. I do that often with GoTo, Special, Find Blanks and a simple formula like =A2. The real problem lies with M:X. The reports is given with twelve months of data laid out in each column. Row 1 is the Date, row 2 has the actual values. I want to copy and transpose the dates into a new field in column Y for each populated row and name it Purchase Date beginning with the first populated record and then bring the corresponding values for each date into column Z naming it Purchase Amount. If you can help I would greatly appreciate it. Sample data is below.
[TABLE="width: 2070"]
<tbody>[TR]
[TD]VENDOR NUMBER
[/TD]
[TD]VENDOR NAME
[/TD]
[TD]MATERIAL
[/TD]
[TD]DESCRIPTION
[/TD]
[TD]VENDOR PART NUMBER
[/TD]
[TD]UOM
[/TD]
[TD]Lead Time
[/TD]
[TD]QTY ON ORDER
[/TD]
[TD]QTY FCST (12 MO)
[/TD]
[TD]TOTAL QTY
[/TD]
[TD]Buyer
[/TD]
[TD]MATERIAL CONTROLLER
[/TD]
[TD]Oct-16
[/TD]
[TD]Nov-16
[/TD]
[TD]Dec-16
[/TD]
[TD]Jan-17
[/TD]
[TD]Feb-17
[/TD]
[TD]Mar-17
[/TD]
[TD]Apr-17
[/TD]
[TD]May-17
[/TD]
[TD]Jun-17
[/TD]
[TD]Jul-17
[/TD]
[TD]Aug-17
[/TD]
[TD]Sep-17
[/TD]
[/TR]
[TR]
[TD]103326
[/TD]
[TD]Palole Corporation DBA
[/TD]
[TD]6000060
[/TD]
[TD]RES MEP-HYPERCEL
[/TD]
[TD]12035
[/TD]
[TD]L
[/TD]
[TD]169
[/TD]
[TD]200
[/TD]
[TD]360
[/TD]
[TD]560
[/TD]
[TD]606
[/TD]
[TD]R10
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]130
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]70
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]150
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]210
[/TD]
[/TR]
[TR]
[TD]103326
[/TD]
[TD]Palole Corporation DBA
[/TD]
[TD]6000124
[/TD]
[TD]FLT MEMBRANE CASSETTE 30K MWCO
[/TD]
[TD]OS030C26
[/TD]
[TD]EA
[/TD]
[TD]61
[/TD]
[TD]195
[/TD]
[TD]0
[/TD]
[TD]195
[/TD]
[TD]606
[/TD]
[TD]R06
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]95
[/TD]
[TD]40
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]60
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]103326
[/TD]
[TD]Palole Corporation DBA
[/TD]
[TD]6000165
[/TD]
[TD]FLT CART 5" 0.2UM HYDROPHILIC
[/TD]
[TD]AB05DFL2PH4
[/TD]
[TD]EA
[/TD]
[TD]50
[/TD]
[TD]0
[/TD]
[TD]24
[/TD]
[TD]24
[/TD]
[TD]606
[/TD]
[TD]R06
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]6
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]6
[/TD]
[TD]12
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]103326
[/TD]
[TD]Palole Corporation DBA
[/TD]
[TD]6000167
[/TD]
[TD]FLT CASSETE 30K MWCO 1FT2
[/TD]
[TD]OS030C12
[/TD]
[TD]EA
[/TD]
[TD]62
[/TD]
[TD]0
[/TD]
[TD]12
[/TD]
[TD]12
[/TD]
[TD]606
[/TD]
[TD]R06
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]12
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]103326
[/TD]
[TD]Palole Corporation DBA
[/TD]
[TD]6000196
[/TD]
[TD]FLT CAPSULE 0.2UM 500CM2 STERI
[/TD]
[TD]12991
[/TD]
[TD]EA
[/TD]
[TD]74
[/TD]
[TD]0
[/TD]
[TD]12
[/TD]
[TD]12
[/TD]
[TD]606
[/TD]
[TD]R06
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]12
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]103326
[/TD]
[TD]Palole Corporation DBA
[/TD]
[TD]6000414
[/TD]
[TD]FLT MEM CASETTE OMEGA T-SERIES
[/TD]
[TD]OS010T06
[/TD]
[TD]EA
[/TD]
[TD]64
[/TD]
[TD]61
[/TD]
[TD]14
[/TD]
[TD]75
[/TD]
[TD]606
[/TD]
[TD]R06
[/TD]
[TD]6
[/TD]
[TD]2
[/TD]
[TD]33
[/TD]
[TD]20
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]14
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]103326
[/TD]
[TD]Palole Corporation DBA
[/TD]
[TD]6001060
[/TD]
[TD]FLT VENT 0.2UM PTFE HYDROPHOBI
[/TD]
[TD]4251
[/TD]
[TD]EA
[/TD]
[TD]70
[/TD]
[TD]0
[/TD]
[TD]59
[/TD]
[TD]59
[/TD]
[TD]606
[/TD]
[TD]R06
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]17
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]15
[/TD]
[TD]0
[/TD]
[TD]27
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]103326
[/TD]
[TD]Palole Corporation DBA
[/TD]
[TD]6001345
[/TD]
[TD]FLT T-SERIES 30KD MWCO 2.5M2 M
[/TD]
[TD]OS030T26
[/TD]
[TD]EA
[/TD]
[TD]64
[/TD]
[TD]36
[/TD]
[TD]26
[/TD]
[TD]62
[/TD]
[TD]606
[/TD]
[TD]R06
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]36
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]8
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]18
[/TD]
[/TR]
[TR]
[TD]103393
[/TD]
[TD]Dill Palmer Instrument Co
[/TD]
[TD]6001166
[/TD]
[TD]ADP Y CONNECTOR 3/8" BARB KYNA
[/TD]
[TD]WU-30703-93
[/TD]
[TD]EA
[/TD]
[TD]19
[/TD]
[TD]0
[/TD]
[TD]760
[/TD]
[TD]760
[/TD]
[TD]606
[/TD]
[TD]R04
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]230
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]220
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]310
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]104008
[/TD]
[TD]Signal-Abbot Inc.
[/TD]
[TD]6000055
[/TD]
[TD]CHM TRANS-4 5-DIHYDROXY-1 2-DI
[/TD]
[TD]D3511
[/TD]
[TD]G
[/TD]
[TD]51
[/TD]
[TD]14,000
[/TD]
[TD]24,876
[/TD]
[TD]38,876
[/TD]
[TD]606
[/TD]
[TD]R01
[/TD]
[TD]0
[/TD]
[TD]14,000
[/TD]
[TD]0
[/TD]
[TD]4,876
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]10,000
[/TD]
[TD]0
[/TD]
[TD]5,000
[/TD]
[TD]0
[/TD]
[TD]5,000
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]104008
[/TD]
[TD]Signal-Abbot Inc.
[/TD]
[TD]6000069
[/TD]
[TD]CHM DEXTRAN SULFATESODIUM SALT
[/TD]
[TD]D6924
[/TD]
[TD]G
[/TD]
[TD]51
[/TD]
[TD]4,000
[/TD]
[TD]8,450
[/TD]
[TD]12,450
[/TD]
[TD]606
[/TD]
[TD]R01
[/TD]
[TD]0
[/TD]
[TD]2,000
[/TD]
[TD]2,000
[/TD]
[TD]0
[/TD]
[TD]3,000
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]2,750
[/TD]
[TD]0
[/TD]
[TD]2,700
[/TD]
[TD]0
[/TD]
[/TR]
[TR]
[TD]107575
[/TD]
[TD]Univarlist Usa Inc
[/TD]
[TD]6000087
[/TD]
[TD]CHM ANTIFOAM-C MED GRADE SILIC
[/TD]
[TD]803579
[/TD]
[TD]G
[/TD]
[TD]20
[/TD]
[TD]0
[/TD]
[TD]906
[/TD]
[TD]906
[/TD]
[TD]605
[/TD]
[TD]R01
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]906
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[TD]0
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Anita Kay,

Welcome to the MrExcel forum.


We would like more information. Please see the Forum Use Guidelines in the following link:

http://www.mrexcel.com/forum/board-announcements/127080-guidelines-forum-use.html


See reply #2 at the next link, if you want to show small screenshots, of the raw data, and, what the results should look like.

http://www.mrexcel.com/forum/about-board/508133-attachments.html#post2507729


Or, you can post your workbook/worksheets to the following free site (sensitive data changed), mark the workbook for sharing, and, provide us with a link to your workbook:

https://dropbox.com
 
Upvote 0
I am including a link to dropbox and a file that will show you the data and the new layout I want to achieve.

https://dl.dropboxusercontent.com/u/40516771/Mr.Excel%20Forum/Anita%20Kay%20Sample%20Data.xlsx

Thanks!
Hello all,

I have been coming the archives of many forums trying to find a good, effective and safe solution for changing the layout of an SAP report exported to Excel 2010. It takes months and months to get them to provide us with information and while we have asked for raw data they seem hesitant to give it to us. They always want to provide us with a report. I am not proficient with VBA but can get around. I do not understand a lot about looping.

What I need to do it to take the spreadsheet and insert twelve rows after each existing record, copy the information from columns A:L into the blanks beneath each populated row. I do that often with GoTo, Special, Find Blanks and a simple formula like =A2. The real problem lies with M:X. The reports is given with twelve months of data laid out in each column. Row 1 is the Date, row 2 has the actual values. I want to copy and transpose the dates into a new field in column Y for each populated row and name it Purchase Date beginning with the first populated record and then bring the corresponding values for each date into column Z naming it Purchase Amount. If you can help I would greatly appreciate it. Sample data is below.
[TABLE="width: 2070"]
<tbody>[TR]
[TD]VENDOR NUMBER[/TD]
[TD]VENDOR NAME[/TD]
[TD]MATERIAL[/TD]
[TD]DESCRIPTION[/TD]
[TD]VENDOR PART NUMBER[/TD]
[TD]UOM[/TD]
[TD]Lead Time[/TD]
[TD]QTY ON ORDER[/TD]
[TD]QTY FCST (12 MO)[/TD]
[TD]TOTAL QTY[/TD]
[TD]Buyer[/TD]
[TD]MATERIAL CONTROLLER[/TD]
[TD]Oct-16[/TD]
[TD]Nov-16[/TD]
[TD]Dec-16[/TD]
[TD]Jan-17[/TD]
[TD]Feb-17[/TD]
[TD]Mar-17[/TD]
[TD]Apr-17[/TD]
[TD]May-17[/TD]
[TD]Jun-17[/TD]
[TD]Jul-17[/TD]
[TD]Aug-17[/TD]
[TD]Sep-17[/TD]
[/TR]
[TR]
[TD]103326[/TD]
[TD]Palole Corporation DBA[/TD]
[TD]6000060[/TD]
[TD]RES MEP-HYPERCEL[/TD]
[TD]12035[/TD]
[TD]L[/TD]
[TD]169[/TD]
[TD]200[/TD]
[TD]360[/TD]
[TD]560[/TD]
[TD]606[/TD]
[TD]R10[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]130[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]70[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]150[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]210[/TD]
[/TR]
[TR]
[TD]103326[/TD]
[TD]Palole Corporation DBA[/TD]
[TD]6000124[/TD]
[TD]FLT MEMBRANE CASSETTE 30K MWCO[/TD]
[TD]OS030C26[/TD]
[TD]EA[/TD]
[TD]61[/TD]
[TD]195[/TD]
[TD]0[/TD]
[TD]195[/TD]
[TD]606[/TD]
[TD]R06[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]95[/TD]
[TD]40[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]60[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]103326[/TD]
[TD]Palole Corporation DBA[/TD]
[TD]6000165[/TD]
[TD]FLT CART 5" 0.2UM HYDROPHILIC[/TD]
[TD]AB05DFL2PH4[/TD]
[TD]EA[/TD]
[TD]50[/TD]
[TD]0[/TD]
[TD]24[/TD]
[TD]24[/TD]
[TD]606[/TD]
[TD]R06[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]6[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]6[/TD]
[TD]12[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]103326[/TD]
[TD]Palole Corporation DBA[/TD]
[TD]6000167[/TD]
[TD]FLT CASSETE 30K MWCO 1FT2[/TD]
[TD]OS030C12[/TD]
[TD]EA[/TD]
[TD]62[/TD]
[TD]0[/TD]
[TD]12[/TD]
[TD]12[/TD]
[TD]606[/TD]
[TD]R06[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]12[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]103326[/TD]
[TD]Palole Corporation DBA[/TD]
[TD]6000196[/TD]
[TD]FLT CAPSULE 0.2UM 500CM2 STERI[/TD]
[TD]12991[/TD]
[TD]EA[/TD]
[TD]74[/TD]
[TD]0[/TD]
[TD]12[/TD]
[TD]12[/TD]
[TD]606[/TD]
[TD]R06[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]12[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]103326[/TD]
[TD]Palole Corporation DBA[/TD]
[TD]6000414[/TD]
[TD]FLT MEM CASETTE OMEGA T-SERIES[/TD]
[TD]OS010T06[/TD]
[TD]EA[/TD]
[TD]64[/TD]
[TD]61[/TD]
[TD]14[/TD]
[TD]75[/TD]
[TD]606[/TD]
[TD]R06[/TD]
[TD]6[/TD]
[TD]2[/TD]
[TD]33[/TD]
[TD]20[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]14[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]103326[/TD]
[TD]Palole Corporation DBA[/TD]
[TD]6001060[/TD]
[TD]FLT VENT 0.2UM PTFE HYDROPHOBI[/TD]
[TD]4251[/TD]
[TD]EA[/TD]
[TD]70[/TD]
[TD]0[/TD]
[TD]59[/TD]
[TD]59[/TD]
[TD]606[/TD]
[TD]R06[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]17[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]15[/TD]
[TD]0[/TD]
[TD]27[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]103326[/TD]
[TD]Palole Corporation DBA[/TD]
[TD]6001345[/TD]
[TD]FLT T-SERIES 30KD MWCO 2.5M2 M[/TD]
[TD]OS030T26[/TD]
[TD]EA[/TD]
[TD]64[/TD]
[TD]36[/TD]
[TD]26[/TD]
[TD]62[/TD]
[TD]606[/TD]
[TD]R06[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]36[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]8[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]18[/TD]
[/TR]
[TR]
[TD]103393[/TD]
[TD]Dill Palmer Instrument Co[/TD]
[TD]6001166[/TD]
[TD]ADP Y CONNECTOR 3/8" BARB KYNA[/TD]
[TD]WU-30703-93[/TD]
[TD]EA[/TD]
[TD]19[/TD]
[TD]0[/TD]
[TD]760[/TD]
[TD]760[/TD]
[TD]606[/TD]
[TD]R04[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]230[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]220[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]310[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]104008[/TD]
[TD]Signal-Abbot Inc.[/TD]
[TD]6000055[/TD]
[TD]CHM TRANS-4 5-DIHYDROXY-1 2-DI[/TD]
[TD]D3511[/TD]
[TD]G[/TD]
[TD]51[/TD]
[TD]14,000[/TD]
[TD]24,876[/TD]
[TD]38,876[/TD]
[TD]606[/TD]
[TD]R01[/TD]
[TD]0[/TD]
[TD]14,000[/TD]
[TD]0[/TD]
[TD]4,876[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]10,000[/TD]
[TD]0[/TD]
[TD]5,000[/TD]
[TD]0[/TD]
[TD]5,000[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]104008[/TD]
[TD]Signal-Abbot Inc.[/TD]
[TD]6000069[/TD]
[TD]CHM DEXTRAN SULFATESODIUM SALT[/TD]
[TD]D6924[/TD]
[TD]G[/TD]
[TD]51[/TD]
[TD]4,000[/TD]
[TD]8,450[/TD]
[TD]12,450[/TD]
[TD]606[/TD]
[TD]R01[/TD]
[TD]0[/TD]
[TD]2,000[/TD]
[TD]2,000[/TD]
[TD]0[/TD]
[TD]3,000[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]2,750[/TD]
[TD]0[/TD]
[TD]2,700[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]107575[/TD]
[TD]Univarlist Usa Inc[/TD]
[TD]6000087[/TD]
[TD]CHM ANTIFOAM-C MED GRADE SILIC[/TD]
[TD]803579[/TD]
[TD]G[/TD]
[TD]20[/TD]
[TD]0[/TD]
[TD]906[/TD]
[TD]906[/TD]
[TD]605[/TD]
[TD]R01[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]906[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[TD]0[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Anita Kay,

Thanks for the workbook/worksheets.

There seems to be a mistake/error in the number of rows for each group, going from the Sample Data worksheet, to the New Layout worksheet.



Excel 2007
LMNOPQRSTUVWX
1MATERIAL CONTROLLEROct-16Nov-16Dec-16Jan-17Feb-17Mar-17Apr-17May-17Jun-17Jul-17Aug-17Sep-17
2R100013000700015000210
Sample Data



Excel 2007
JK
1MATERIAL CONTROLLERProject Date
2R10Oct-16
3R10Nov-16
4R10Dec-16
5R10Jan-17
6R10Feb-17
7R10Mar-17
8R10Apr-17
9R10May-17
10R10Jun-17
11R10Jul-17
12R10Aug-17
13R10Sep-17
14R10Oct-16
New Layout


The New Layout worksheet contains 13 rows with the date Oct-16 duplicated 2 times. Is that correct?
 
Last edited:
Upvote 0
So sorry, I could have made a mistake. since each vendor already has one row, I really only need to insert 11 rows for each. I did this mockup late while trying to concentrate on another project.


Anita Kay,

Thanks for the workbook/worksheets.

There seems to be a mistake/error in the number of rows for each group, going from the Sample Data worksheet, to the New Layout worksheet.


Excel 2007
LMNOPQRSTUVWX

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #BFBFBF, align: center"]MATERIAL CONTROLLER[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Oct-16[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Nov-16[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Dec-16[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Jan-17[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Feb-17[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Mar-17[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Apr-17[/TD]
[TD="bgcolor: #BFBFBF, align: right"]May-17[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Jun-17[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Jul-17[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Aug-17[/TD]
[TD="bgcolor: #BFBFBF, align: right"]Sep-17[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]130[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]70[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]150[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"]210[/TD]

</tbody>
Sample Data



Excel 2007
JK

<colgroup><col style="width: 25pxpx"><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="bgcolor: #BFBFBF, align: center"]MATERIAL CONTROLLER[/TD]
[TD="bgcolor: #BFBFBF, align: center"]Project Date[/TD]

[TD="align: center"]2[/TD]
[TD="align: center"]R10[/TD]
[TD="bgcolor: #FFFF00, align: right"]Oct-16[/TD]

[TD="align: center"]3[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]Nov-16[/TD]

[TD="align: center"]4[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]Dec-16[/TD]

[TD="align: center"]5[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]Jan-17[/TD]

[TD="align: center"]6[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]Feb-17[/TD]

[TD="align: center"]7[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]Mar-17[/TD]

[TD="align: center"]8[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]Apr-17[/TD]

[TD="align: center"]9[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]May-17[/TD]

[TD="align: center"]10[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]Jun-17[/TD]

[TD="align: center"]11[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]Jul-17[/TD]

[TD="align: center"]12[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]Aug-17[/TD]

[TD="align: center"]13[/TD]
[TD="align: center"]R10[/TD]
[TD="align: right"]Sep-17[/TD]

[TD="align: center"]14[/TD]
[TD="align: center"]R10[/TD]
[TD="bgcolor: #FFFF00, align: right"]Oct-16[/TD]

</tbody>
New Layout



The New Layout worksheet contains 13 rows with the date Oct-16 duplicated 2 times. Is that correct?
 
Upvote 0
I should clarify that each vendor will have twelve monthly periods, some with values of zero. If you see the months repeated it should be because it is a different vendor.

Thanks!

So sorry, I could have made a mistake. since each vendor already has one row, I really only need to insert 11 rows for each. I did this mockup late while trying to concentrate on another project.
 
Upvote 0
Anita Kay,

Here is macro for you to consider, that uses two arrays in memory, and, should be very fast.

You can change the worksheet names in the macro.

I assume that both worksheets already exist, and, that the New Layout worksheet contains titles in row 1.

Sample raw data worksheet in two screenshots to fit the MrExcel display area:


Excel 2007
ABCDEFGHI
1VENDOR NUMBERVENDOR NAMEMATERIALDESCRIPTIONVENDOR PART NUMBERUOMLead TimeQTY ON ORDERQTY FCST (12 MO)
2103326Palole Corporation DBA6000060RES MEP-HYPERCEL12035L169200360
3103326Palole Corporation DBA6000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950
4103326Palole Corporation DBA6000165FLT CART 5" 0.2UM HYDROPHILICAB05DFL2PH4EA50024
5103326Palole Corporation DBA6000167FLT CASSETE 30K MWCO 1FT2OS030C12EA62012
6103326Palole Corporation DBA6000196FLT CAPSULE 0.2UM 500CM2 STERI12991EA74012
7103326Palole Corporation DBA6000414FLT MEM CASETTE OMEGA T-SERIESOS010T06EA646114
8103326Palole Corporation DBA6001060FLT VENT 0.2UM PTFE HYDROPHOBI4251EA70059
9103326Palole Corporation DBA6001345FLT T-SERIES 30KD MWCO 2.5M2 MOS030T26EA643626
10103393Dill Palmer Instrument Co6001166ADP Y CONNECTOR 3/8" BARB KYNAWU-30703-93EA190760
11104008Signal-Abbot Inc.6000055CHM TRANS-4 5-DIHYDROXY-1 2-DID3511G5114,00024,876
12104008Signal-Abbot Inc.6000069CHM DEXTRAN SULFATESODIUM SALTD6924G514,0008,450
13107575Univarlist Usa Inc6000087CHM ANTIFOAM-C MED GRADE SILIC803579G200906
14
Sample Data



Excel 2007
JKLMNOPQRSTUVWX
1TOTAL QTYBuyerMATERIAL CONTROLLEROct-16Nov-16Dec-16Jan-17Feb-17Mar-17Apr-17May-17Jun-17Jul-17Aug-17Sep-17
2560606R100013000700015000210
3195606R06000954000006000
424606R060000006006120
512606R060000012000000
612606R060001200000000
775606R06623320000014000
859606R06000001700150270
962606R0600360080000018
10760606R04000023000220003100
1138,876606R01014,00004,8760010,00005,00005,0000
1212,450606R0102,0002,00003,0000002,75002,7000
13906605R0100000090600000
14
Sample Data




Excel 2007
ABCDEFGHIJKLM
1MATERIALDESCRIPTIONVENDOR PART NUMBERUOMLead TimeQTY ON ORDERQTY FCST (12 MO)TOTAL QTYBuyerMATERIAL CONTROLLERProject DateActual Quantity
2
3
4
5
6
7
8
9
New Layout


And, after the macro (not all rows are shown for brevity):


Excel 2007
ABCDEFGHIJKL
1MATERIALDESCRIPTIONVENDOR PART NUMBERUOMLead TimeQTY ON ORDERQTY FCST (12 MO)TOTAL QTYBuyerMATERIAL CONTROLLERProject DateActual Quantity
26000060RES MEP-HYPERCEL12035L169200360560Oct-160
36000060RES MEP-HYPERCEL12035L169200360560Nov-160
46000060RES MEP-HYPERCEL12035L169200360560Dec-16130
56000060RES MEP-HYPERCEL12035L169200360560Jan-170
66000060RES MEP-HYPERCEL12035L169200360560Feb-170
76000060RES MEP-HYPERCEL12035L169200360560Mar-1770
86000060RES MEP-HYPERCEL12035L169200360560Apr-170
96000060RES MEP-HYPERCEL12035L169200360560May-170
106000060RES MEP-HYPERCEL12035L169200360560Jun-17150
116000060RES MEP-HYPERCEL12035L169200360560Jul-170
126000060RES MEP-HYPERCEL12035L169200360560Aug-170
136000060RES MEP-HYPERCEL12035L169200360560Sep-17210
146000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Oct-160
156000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Nov-160
166000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Dec-160
176000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Jan-1795
186000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Feb-1740
196000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Mar-170
206000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Apr-170
216000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195May-170
226000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Jun-170
236000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Jul-1760
246000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Aug-170
256000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195Sep-170
New Layout



See my next reply for the macro code.
 
Upvote 0
Anita Kay,

Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

1. Copy the below code
2. Open your NEW workbook
3. Press the keys ALT + F11 to open the Visual Basic Editor
4. Press the keys ALT + I to activate the Insert menu
5. Press M to insert a Standard Module
6. Where the cursor is flashing, paste the code
7. Press the keys ALT + Q to exit the Editor, and return to Excel
8. To run the macro from Excel press ALT + F8 to display the Run Macro Dialog. Double Click the macro's name to Run it.

Code:
Sub Reorg_SAP_Report()
' hiker95, 01/27/2017, ME987801
Dim a As Variant, i As Long, c As Long, cc As Long, d As Long, lr As Long, lc As Long
Dim o As Variant, j As Long, n As Long
Application.ScreenUpdating = False
With Sheets("Sample Data")    '<-- you can change the sheet name here
  lr = .Cells(Rows.Count, 1).End(xlUp).Row
  lc = .Cells(1, Columns.Count).End(xlToLeft).Column
  a = .Range(.Cells(1, 1), .Cells(lr, lc))
  ReDim o(1 To (lr + 1) * 12, 1 To 12)
End With
For i = 2 To UBound(a, 1) Step 1
  cc = 13
  For n = 1 To 12 Step 1
    j = j + 1
    d = 1
    For c = 3 To 10 Step 1
      o(j, d) = a(i, c)
      d = d + 1
    Next c
    o(j, 11) = a(1, cc)
    o(j, 12) = a(i, cc)
    cc = cc + 1
  Next n
Next i
With Sheets("New Layout")    '<-- you can change the sheet name here
  lr = .Cells(Rows.Count, 1).End(xlUp).Row
  If lr > 1 Then
    .Range("A2:L" & lr).ClearContents
  End If
  .Range("A2").Resize(UBound(o, 1), UBound(o, 2)) = o
  .Range("K2").Resize(UBound(o, 1)).NumberFormat = "mmm-yy"
  .Columns(1).Resize(, UBound(o, 2)).AutoFit
  .Activate
End With
Application.ScreenUpdating = True
End Sub

Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm, and, answer the "do you want to enable macros" question as "yes" or "OK" (depending on the button label for your version of Excel) the next time you open your workbook.

Then run the Reorg_SAP_Report macro.
 
Upvote 0
Anita Kay,

Sample new results in worksheet New Layout:


Excel 2007
ABCDEFGHIJKL
1MATERIALDESCRIPTIONVENDOR PART NUMBERUOMLead TimeQTY ON ORDERQTY FCST (12 MO)TOTAL QTYBuyerMATERIAL CONTROLLERProject DateActual Quantity
26000060RES MEP-HYPERCEL12035L169200360560606R10Oct-160
36000060RES MEP-HYPERCEL12035L169200360560606R10Nov-160
46000060RES MEP-HYPERCEL12035L169200360560606R10Dec-16130
56000060RES MEP-HYPERCEL12035L169200360560606R10Jan-170
66000060RES MEP-HYPERCEL12035L169200360560606R10Feb-170
76000060RES MEP-HYPERCEL12035L169200360560606R10Mar-1770
86000060RES MEP-HYPERCEL12035L169200360560606R10Apr-170
96000060RES MEP-HYPERCEL12035L169200360560606R10May-170
106000060RES MEP-HYPERCEL12035L169200360560606R10Jun-17150
116000060RES MEP-HYPERCEL12035L169200360560606R10Jul-170
126000060RES MEP-HYPERCEL12035L169200360560606R10Aug-170
136000060RES MEP-HYPERCEL12035L169200360560606R10Sep-17210
146000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Oct-160
156000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Nov-160
166000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Dec-160
176000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Jan-1795
186000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Feb-1740
196000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Mar-170
206000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Apr-170
216000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06May-170
226000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Jun-170
236000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Jul-1760
246000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Aug-170
256000124FLT MEMBRANE CASSETTE 30K MWCOOS030C26EA611950195606R06Sep-170
New Layout





Code:
Sub Reorg_SAP_Report_V2()
' hiker95, 01/27/2017, ME987801
Dim a As Variant, i As Long, c As Long, cc As Long, d As Long, lr As Long, lc As Long
Dim o As Variant, j As Long, n As Long
Application.ScreenUpdating = False
With Sheets("Sample Data")    '<-- you can change the sheet name here
  lr = .Cells(Rows.Count, 1).End(xlUp).Row
  lc = .Cells(1, Columns.Count).End(xlToLeft).Column
  a = .Range(.Cells(1, 1), .Cells(lr, lc))
  ReDim o(1 To (lr + 1) * 12, 1 To 12)
End With
For i = 2 To UBound(a, 1) Step 1
  cc = 13
  For n = 1 To 12 Step 1
    j = j + 1
    d = 1
    For c = 3 To 12 Step 1
      o(j, d) = a(i, c)
      d = d + 1
    Next c
    o(j, 11) = a(1, cc)
    o(j, 12) = a(i, cc)
    cc = cc + 1
  Next n
Next i
With Sheets("New Layout")    '<-- you can change the sheet name here
  lr = .Cells(Rows.Count, 1).End(xlUp).Row
  If lr > 1 Then
    .Range("A2:L" & lr).ClearContents
  End If
  .Range("A2").Resize(UBound(o, 1), UBound(o, 2)) = o
  .Range("K2").Resize(UBound(o, 1)).NumberFormat = "mmm-yy"
  .Columns(1).Resize(, UBound(o, 2)).AutoFit
  .Activate
End With
Application.ScreenUpdating = True
End Sub

Same instructions per my reply #8.

Then run the Reorg_SAP_Report_V2 macro.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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