Covert cells with multiple data to rows

maxnimrod

New Member
Joined
Aug 15, 2017
Messages
9
We use a SharePoint library for end users to submit requests for changes. Because they can submit multiple lines of changes, this produces an output file like the one below.

I don't mind copying the data and pasting it to another sheet. However that can be quite time consuming when there are dozens of requests. Plus, other people may process these so I need an easier solution.

ABCDEFGHI
Row1Record #DateRequestorR#U#Data1Data2Data3# of Requests
Row21014-JulJohn2001ABCRedGreenYes5
2002DEFBrownOrangeNo
2003GHIPurpleBlueNo
2004JKLYellowPinkYes
2005MNOBlackWhiteNo
Row31047-JulMike3011PFYRedGreenYes5
3012GHKBrownOrangeNo
3013DCCPurpleBlueNo
3014MMZYellowPinkYes
3015XGFBlackWhiteNo
Row 41059-JulJack2009DCFGreenBlackNo1

<tbody>
</tbody><colgroup><col><col><col><col><col span="5"><col></colgroup>

For example, On July 4th, John submitted a request that contained 5 changes. His request first request # is 2001 and he needs artifact ABC changed from Red to Green. And yes or no for manager approval.
Column I contains the number of requests Each user submitted, so that may be helpful. You will notice that the request in row 4 only contained 1 request. So those would be ok as they are.

I need an easy way to put each row of data that a user submits into it's own row. I don't care so much if columns A, B and C don't get copied down. It is easy enough to drag them after the fact.

Any advice would be greatly appreciated.
Thank ;)
 
Hey guys))

No worries about the time Frank. Our personal lives are what's important.
I appreciate all the work you both put into this. I can get both of these to run without a problem, but it looks like the issue remains the same. The data in D-G doesn't seem to have any delimiter and that is what is causing this. So what happens with frank_AL's script is that it stops when it gets to cloud D. and Fluff script just duplicates the rows with the same formatting as it started with.

It looks like (and this is from pasting the data to plain text) that in each one of those cells, the data is enclosed in quotes. Ex. D2 would look like this: "39823053990521399060139906053990607399060839928293992835399285039928743992878" All those request ID's are the same length. But in the rest of the columns, that wouldn't be the case.

It almost seems to me there isn't a way to iron this out. The data is submitted through an InfoPath form that has a repeating table. So that is why SharePoint stores the data the way it does. But without any common delimiter, I don't see a way this could work. But you guys know code much better than me. I had a post in the SharePoint forums for a while last year, but they basically dismissed it as it is the way the query builds the data. I may have to rework the process so it creates one row for each line item instead of grouping them together.

Thanks again for all your help. It is greatly appreciated.
 
Upvote 0

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
If you expand column D so that it is 4 or 5 times wider then needed, do you get all the numbers one below the other, or do you get some of them side by side?
 
Upvote 0
Sorry, the text is wrapped by default. If you remove the wrapping, they all run together. I should have noticed that.
 
Upvote 0
OK in the sheet press
Ctrl F
in the Find what box type
Alt 0010 (using the number keypad) & then click Find All.
Does it find anything? if not do the same again, but lookfor
Alt 0013
 
Upvote 0
Oh, that's interesting.
I got a hit on 0010 in every cell in every column that has stacked data. D-H. It does not hit on those columns when only one value exists in those cells.
 
Upvote 0
Oh, that's interesting.
I got a hit on 0010 in every cell in every column that has stacked data. D-H. It does not hit on those columns when only one value exists in those cells.
From what you said in post#13 I suspected you'd say something like that.
try this
Code:
' maxnimrod (zz2)

    Dim Usdrws As Long
    Dim Rws As Long
    Dim Cnt As Long
    Dim Cols As Long

Application.ScreenUpdating = False

    Usdrws = Range("A" & Rows.Count).End(xlUp).Row
    
    For Rws = Usdrws To 2 Step -1
        Cnt = Range("I" & Rws).Value
        If Cnt > 1 Then
            Rows(Rws + 1).Resize(Cnt - 1).Insert
            Range("A" & Rws & ":C" & Rws).Resize(Cnt).FillDown
            For Cols = 4 To 8
                Cells(Rws, Cols).Resize(Cnt).Value = Application.Transpose(Split(Cells(Rws, Cols).Value, Chr(10)))
            Next Cols
        End If
    Next Rws

End Sub
 
Upvote 0
Wow, you nailed it!!

It works perfectly. I ran it against a fresh list that I just pulled.

That turned out to be a prefect test because people left out request numbers and some other data. It left the blanks just where they should be. And it also ignored two entries that were single line items. What else can I say besides THANK YOU!!

I really appreciate what you and everyone else does here. This will save me a lot of time and it will make it easier for other people to cover this process when I am out.

Thanks again ))
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,561
Members
449,089
Latest member
Motoracer88

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