SharePoint Export from Infopath to Excel - How to Split Multiple Lines of Data into Separate Rows?

blooddiamondkim

New Member
Joined
May 10, 2016
Messages
2
I am desperately hoping someone can help me, as I've repeatedly run into a wall for about two weeks now trying to solve this problem and I've finally admitted to myself that a solution is beyond my scope of knowledge. I should note I'm working in Excel 2010.

I have an InfoPath form that submits data in repeating tables to SharePoint. People export the SharePoint list data to Excel and need it formatted a certain way; the problem is that each column in a repeating table pulls all of the entered data into one cell separated by carriage returns (ALT+ENTER) when viewed in Excel.

The number of items in each cell is variable (depending on how many repeating table fields the person fills out), but the number of items across cells stays the same. For example, cell A1 has 3 items in one cell, but that means that columns B - H also have three items in each cell.

Each export can have hundreds of line items - it will increase throughout the year as more forms are submitted, so the number of lines is unknown. The number of items in each cell, as mentioned above, is unknown.

An example of how the data exports into Excel is below:

Doc DateDoc NumberCost ElementAmountNew NetworkNew ActivityCurrent NWCurrent Activity
2016-02-10T00:00:00
2016-05-26T00:00:00
2016-05-18T00:00:00
1234567890
5468546314
568921345
511965
5299.8555
710007
2000
3211.52
4000
987654321987
100001234567
100001216899
0100
0090
0020
123456789123
100001215689
100000659822
0060
0080
0100
2016-02-29T00:00:00
12115589
960209
3000
1000056789100020100001234567
0010

I need the cell content split into separate rows with the formatting needs listed on the "Final" tab's headers, and with Doc Date formatted as YYYYMMDD; the macro needs to continue until the export data has all been split; I've tried recording a macro that:

1) Copies a row to "Working" tab
2) Goes column by column with text to columns, setting "TEXT" format for the defined columns (noted on the "Final" tab) transpose, then paste values into "Final" tab to use as the final summary
3) Changes "Doc Date" formatting to YYYYMMDD format

Essentially, it needs to come out looking like this:

Doc DateDoc NumberCost ElementAmountNew NetworkNew ActivityCurrent NWCurrent NWA
201602101234567890511965200098765432198701001234567891230060
2016052654685463145299.85553211.5210000123456700901000012156890080
20160518568921345710007400010000121689900201000006598220100
2016022912115589960209300010000567891000201000012345670010

The macros I have tried recording on my own stop working because of the variability of the number of line items in each cell. No matter what I have tried, I cannot get it to work and I have realized maybe this needs to be VBA, which is far beyond the scope of my abilities. I feel defeated by this issue and desperately hope someone can help me out. I would greatly appreciate it.

A link to the workbook itself is below:

https://onedrive.live.com/redir?res...468&authkey=!ABCQiMxPVmQU_g4&ithint=file,xlsm
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,215,110
Messages
6,123,143
Members
449,098
Latest member
Doanvanhieu

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