VBA Use dynamic array to create custom report

DFlem

New Member
Joined
Jul 20, 2022
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Please assist if you can! I have an exported Excel report, each row is a new customer, but the rows stop at 137. There are about 250 columns with customer details, but only 5 columns belong to 1 customer in each row. My boss wants me to format this report to reflect each customer in individual rows. I have attempted stacking, transposing, unpivoting, dynamic arrays and index. However, when creating my 2 dimensional dynamic array for the dynamic report, my output is listing everything except my customer columns into rows. Is there a way for me to custom output my rows and columns into specific rows or is there an easier way.

Also another catch is that the first few columns in my worksheet includes data that must be applied to everyone individual customer in that corresponding row. I have attached an image for additional reference.

Any assistance is greatly appreciated!
 

Attachments

  • Screenshot (4).png
    Screenshot (4).png
    29.5 KB · Views: 16

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
Welcome to the MrExcel Forum. I have a couple of questions.
1) From your attachment, it appears that for each of the 137 rows there are minimally five customers per row and probably more like 20 customers per row with each customer having 7 columns of common information and 5 columns of customer specific information - does that sound correct.
2) From your attachment it is impossible to know what character(s) are used to separate (delimit) each item of information from the Raw Data Input. In my below code example I used a double-space, I doubt that is what your generated report is using. One way to find out would be to use this formula on whatever cell (I used Cell A1) that contains the line from you Raw Data Input:
Excel Formula:
=CODE(MID(A1,10,1))
This character is the delimiter and is the single most import part of the code. Remember, I used a double-space as the delimiter.
In my code I used "Sheet1" as the sheet with the Raw Data and outputted Required Output to "Sheet2", starting in Row 2, leaving Row 1 for a Header Row.

Split text.xlsm
A
1Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 1 Ready/permit 1 Type 1 S M 1 Quantity 1 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 2 Ready/permit 2 Type 2 S M 2 Quantity 2 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 3 Ready/permit 3 Type 3 S M 3 Quantity 3 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 4 Ready/permit 4 Type 4 S M 4 Quantity 4 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 5 Ready/permit 5 Type 5 S M 5 Quantity 5
2Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 6 Ready/permit 1 Type 1 S M 1 Quantity 1 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 7 Ready/permit 2 Type 2 S M 2 Quantity 2 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 8 Ready/permit 3 Type 3 S M 3 Quantity 3 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 9 Ready/permit 4 Type 4 S M 4 Quantity 4 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 10 Ready/permit 5 Type 5 S M 5 Quantity 5
3
Sheet1


VBA Code:
Sub SplitRaw()

    Dim inp As String, del As String
    Dim lines, ct As Long, i As Long, rpt As Long, lRow As Long, ct2 As Long
    Dim ws1 As Worksheet: Set ws1 = Worksheets("Sheet1")
    Dim ws2 As Worksheet: Set ws2 = Worksheets("Sheet2")
    
    lRow = ws1.Cells(Rows.Count, 1).End(xlUp).Row
    For i = 1 To lRow
        inp = inp & ws1.Range("A" & i) & "  "
    Next
    del = "  "  '**** This is where the Delimiter goes ****
    lines = Split(inp, del)
    rpt = 0: ct = 2
    For ct2 = 0 To 10
    If rpt > UBound(lines) - 2 Then Exit Sub
        ws2.Cells(ct, 1) = lines(0 + rpt)
        ws2.Cells(ct, 2) = lines(1 + rpt)
        ws2.Cells(ct, 3) = lines(2 + rpt)
        ws2.Cells(ct, 4) = lines(3 + rpt)
        ws2.Cells(ct, 5) = lines(4 + rpt)
        ws2.Cells(ct, 6) = lines(5 + rpt)
        ws2.Cells(ct, 7) = lines(6 + rpt)
        ws2.Cells(ct, 8) = lines(7 + rpt)
        ws2.Cells(ct, 9) = lines(8 + rpt)
        ws2.Cells(ct, 10) = lines(9 + rpt)
        ws2.Cells(ct, 11) = lines(10 + rpt)
        rpt = rpt + 11
        ct = ct + 1
    Next
  
End Sub

Split text.xlsm
ABCDEFGHIJK
1Header Row
2Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 1Ready/permit 1Type 1S M 1Quantity 1
3Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 2Ready/permit 2Type 2S M 2Quantity 2
4Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 3Ready/permit 3Type 3S M 3Quantity 3
5Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 4Ready/permit 4Type 4S M 4Quantity 4
6Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 5Ready/permit 5Type 5S M 5Quantity 5
7Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 6Ready/permit 1Type 1S M 1Quantity 1
8Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 7Ready/permit 2Type 2S M 2Quantity 2
9Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 8Ready/permit 3Type 3S M 3Quantity 3
10Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 9Ready/permit 4Type 4S M 4Quantity 4
11Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 10Ready/permit 5Type 5S M 5Quantity 5
12
13
Sheet2
 
Upvote 0
Welcome to the MrExcel Forum. I have a couple of questions.
1) From your attachment, it appears that for each of the 137 rows there are minimally five customers per row and probably more like 20 customers per row with each customer having 7 columns of common information and 5 columns of customer specific information - does that sound correct.
2) From your attachment it is impossible to know what character(s) are used to separate (delimit) each item of information from the Raw Data Input. In my below code example I used a double-space, I doubt that is what your generated report is using. One way to find out would be to use this formula on whatever cell (I used Cell A1) that contains the line from you Raw Data Input:
Excel Formula:
=CODE(MID(A1,10,1))
This character is the delimiter and is the single most import part of the code. Remember, I used a double-space as the delimiter.
In my code I used "Sheet1" as the sheet with the Raw Data and outputted Required Output to "Sheet2", starting in Row 2, leaving Row 1 for a Header Row.

Split text.xlsm
A
1Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 1 Ready/permit 1 Type 1 S M 1 Quantity 1 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 2 Ready/permit 2 Type 2 S M 2 Quantity 2 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 3 Ready/permit 3 Type 3 S M 3 Quantity 3 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 4 Ready/permit 4 Type 4 S M 4 Quantity 4 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 5 Ready/permit 5 Type 5 S M 5 Quantity 5
2Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 6 Ready/permit 1 Type 1 S M 1 Quantity 1 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 7 Ready/permit 2 Type 2 S M 2 Quantity 2 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 8 Ready/permit 3 Type 3 S M 3 Quantity 3 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 9 Ready/permit 4 Type 4 S M 4 Quantity 4 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 10 Ready/permit 5 Type 5 S M 5 Quantity 5
3
Sheet1


VBA Code:
Sub SplitRaw()

    Dim inp As String, del As String
    Dim lines, ct As Long, i As Long, rpt As Long, lRow As Long, ct2 As Long
    Dim ws1 As Worksheet: Set ws1 = Worksheets("Sheet1")
    Dim ws2 As Worksheet: Set ws2 = Worksheets("Sheet2")
   
    lRow = ws1.Cells(Rows.Count, 1).End(xlUp).Row
    For i = 1 To lRow
        inp = inp & ws1.Range("A" & i) & "  "
    Next
    del = "  "  '**** This is where the Delimiter goes ****
    lines = Split(inp, del)
    rpt = 0: ct = 2
    For ct2 = 0 To 10
    If rpt > UBound(lines) - 2 Then Exit Sub
        ws2.Cells(ct, 1) = lines(0 + rpt)
        ws2.Cells(ct, 2) = lines(1 + rpt)
        ws2.Cells(ct, 3) = lines(2 + rpt)
        ws2.Cells(ct, 4) = lines(3 + rpt)
        ws2.Cells(ct, 5) = lines(4 + rpt)
        ws2.Cells(ct, 6) = lines(5 + rpt)
        ws2.Cells(ct, 7) = lines(6 + rpt)
        ws2.Cells(ct, 8) = lines(7 + rpt)
        ws2.Cells(ct, 9) = lines(8 + rpt)
        ws2.Cells(ct, 10) = lines(9 + rpt)
        ws2.Cells(ct, 11) = lines(10 + rpt)
        rpt = rpt + 11
        ct = ct + 1
    Next
 
End Sub

Split text.xlsm
ABCDEFGHIJK
1Header Row
2Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 1Ready/permit 1Type 1S M 1Quantity 1
3Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 2Ready/permit 2Type 2S M 2Quantity 2
4Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 3Ready/permit 3Type 3S M 3Quantity 3
5Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 4Ready/permit 4Type 4S M 4Quantity 4
6Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 5Ready/permit 5Type 5S M 5Quantity 5
7Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 6Ready/permit 1Type 1S M 1Quantity 1
8Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 7Ready/permit 2Type 2S M 2Quantity 2
9Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 8Ready/permit 3Type 3S M 3Quantity 3
10Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 9Ready/permit 4Type 4S M 4Quantity 4
11Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 10Ready/permit 5Type 5S M 5Quantity 5
12
13
Sheet2
Hi.
Thank you for the warm welcome and your willingness to assist. There are actually 137 rows in my raw data report. Every row is a new customer, but not all rows are filled. That is just the format of the report and instead of the rows continuing in one column, after 137 rows the customers data continues in a new column and so on. The raw report has a total of 40 customers with adjacent data in into 5 columns. I apologize if that is confusing. I am very new to VBA.

How can I edit your sample data to reflect the 137 rows and adjacent customer data columns while separating the continued new customer list in columns?
 
Upvote 0
Please assist if you can! I have an exported Excel report, each row is a new customer, but the rows stop at 137. There are about 250 columns with customer details, but only 5 columns belong to 1 customer in each row. My boss wants me to format this report to reflect each customer in individual rows. I have attempted stacking, transposing, unpivoting, dynamic arrays and index. However, when creating my 2 dimensional dynamic array for the dynamic report, my output is listing everything except my customer columns into rows. Is there a way for me to custom output my rows and columns into specific rows or is there an easier way.

Also another catch is that the first few columns in my worksheet includes data that must be applied to everyone individual customer in that corresponding row. I have attached an image for additional reference.

Any assistance is greatly appreciated!
Welcome to the MrExcel Forum. I have a couple of questions.
1) From your attachment, it appears that for each of the 137 rows there are minimally five customers per row and probably more like 20 customers per row with each customer having 7 columns of common information and 5 columns of customer specific information - does that sound correct.
2) From your attachment it is impossible to know what character(s) are used to separate (delimit) each item of information from the Raw Data Input. In my below code example I used a double-space, I doubt that is what your generated report is using. One way to find out would be to use this formula on whatever cell (I used Cell A1) that contains the line from you Raw Data Input:
Excel Formula:
=CODE(MID(A1,10,1))
This character is the delimiter and is the single most import part of the code. Remember, I used a double-space as the delimiter.
In my code I used "Sheet1" as the sheet with the Raw Data and outputted Required Output to "Sheet2", starting in Row 2, leaving Row 1 for a Header Row.

Split text.xlsm
A
1Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 1 Ready/permit 1 Type 1 S M 1 Quantity 1 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 2 Ready/permit 2 Type 2 S M 2 Quantity 2 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 3 Ready/permit 3 Type 3 S M 3 Quantity 3 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 4 Ready/permit 4 Type 4 S M 4 Quantity 4 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 5 Ready/permit 5 Type 5 S M 5 Quantity 5
2Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 6 Ready/permit 1 Type 1 S M 1 Quantity 1 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 7 Ready/permit 2 Type 2 S M 2 Quantity 2 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 8 Ready/permit 3 Type 3 S M 3 Quantity 3 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 9 Ready/permit 4 Type 4 S M 4 Quantity 4 Work Type OW.O.# MP.O.# CW.O.# P Number Ticket Number Customer 10 Ready/permit 5 Type 5 S M 5 Quantity 5
3
Sheet1


VBA Code:
Sub SplitRaw()

    Dim inp As String, del As String
    Dim lines, ct As Long, i As Long, rpt As Long, lRow As Long, ct2 As Long
    Dim ws1 As Worksheet: Set ws1 = Worksheets("Sheet1")
    Dim ws2 As Worksheet: Set ws2 = Worksheets("Sheet2")
   
    lRow = ws1.Cells(Rows.Count, 1).End(xlUp).Row
    For i = 1 To lRow
        inp = inp & ws1.Range("A" & i) & "  "
    Next
    del = "  "  '**** This is where the Delimiter goes ****
    lines = Split(inp, del)
    rpt = 0: ct = 2
    For ct2 = 0 To 10
    If rpt > UBound(lines) - 2 Then Exit Sub
        ws2.Cells(ct, 1) = lines(0 + rpt)
        ws2.Cells(ct, 2) = lines(1 + rpt)
        ws2.Cells(ct, 3) = lines(2 + rpt)
        ws2.Cells(ct, 4) = lines(3 + rpt)
        ws2.Cells(ct, 5) = lines(4 + rpt)
        ws2.Cells(ct, 6) = lines(5 + rpt)
        ws2.Cells(ct, 7) = lines(6 + rpt)
        ws2.Cells(ct, 8) = lines(7 + rpt)
        ws2.Cells(ct, 9) = lines(8 + rpt)
        ws2.Cells(ct, 10) = lines(9 + rpt)
        ws2.Cells(ct, 11) = lines(10 + rpt)
        rpt = rpt + 11
        ct = ct + 1
    Next
 
End Sub

Split text.xlsm
ABCDEFGHIJK
1Header Row
2Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 1Ready/permit 1Type 1S M 1Quantity 1
3Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 2Ready/permit 2Type 2S M 2Quantity 2
4Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 3Ready/permit 3Type 3S M 3Quantity 3
5Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 4Ready/permit 4Type 4S M 4Quantity 4
6Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 5Ready/permit 5Type 5S M 5Quantity 5
7Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 6Ready/permit 1Type 1S M 1Quantity 1
8Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 7Ready/permit 2Type 2S M 2Quantity 2
9Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 8Ready/permit 3Type 3S M 3Quantity 3
10Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 9Ready/permit 4Type 4S M 4Quantity 4
11Work TypeOW.O.#MP.O.#CW.O.#P NumberTicket NumberCustomer 10Ready/permit 5Type 5S M 5Quantity 5
12
13
Sheet2

This may better an better view for reference. Thanks again!

RAW DATA REPORT
Book1
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1Work TypeM W 0#M P O#C WO#CPO3P NUMTICKET NUMCUSTOMER COL 1READY/PERMIT 1TYPE 1SM 1QUANTITY 1CUSTOMER COL 2 READY/PERMIT 2TYPE 2SM 2QUANTITY 2CUSTOMER COL 3READY/PERMIT 3TYPE 3SM3 QUANTITY 3CUSTOMER 4READY/PERMIT 4TYPE 4SM 4
2XXXX12311110123234567344547764CASTREADYTRANSFER1223481JIMPERMITPULL356741WIRELESS READYTYPE235664562WIRELESSPERMITTYPE2353
3XXXX123411110123234567344547764SUEPERMITTRANSFER12234823JOEPERMITTRANSFER5363423CABLEREADYTYPE46543WIRELESSPERMITWORK46
4XXXX12311110123234567344547764MARYPERMITTRANSFER1223482JACKPERMITTRACK533TRACKSREADYTYPE63643WIRELESSPERMITPULL346
5XXXX123411110123234567344547764JIMREADYTRANSFER1223483CABLEPERMITTRANSFER6764TRAINREADYTYPE3634643WIRELESSPERMITPOLE457
6XXXX12311110123234567344547764MOBILEPERMITTRANSFER1223484TRAPPERMITPULL5675675SIMREADYTYPE3634643WIRELESSPERMITTYPE346
7XXXX123411110123234567344547764NULLSHOEPERMITPULL6544CABLEREADYTYPE3634643WIRELESSPERMITTYPE3
8XXXX123411110123234567344547764UNKNOWNREADYTRANSFER12234825PHONEPERMITPULL654CODEREADYTYPE3634643WIRELESSPERMITTYPE6
9XXXX123411110123234567344547764CABLEREADYTRANSFER12234856ELECTRICPERMITPULL654EXCELREADYTYPE3634643WIRELESSPERMITTYPE6
10XXXX123411110123234567344547764WIRELESSREADYTRANSFER12234844WIRELESSPERMITPULL65465VBAREADYTYPE3634643WIRELESSPERMITTYPE
11XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE65
12XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE4.00E+05
13XXXX123411110123234567344547764NULLWIRELESSPERMITPULL65465VBAREADYTYPE3634643WIRELESSPERMITTYPE45
14XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESS
15XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE
16XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547WIRELESSPERMITTYPE7
17XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE5
18XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE6
19XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481VBAREADYTYPE3634643WIRELESSPERMITTYPE3
20XXXX123411110123234567344547764WIRELESSREADYTRANSFER12234817VBAREADYTYPE3634643WIRELESSPERMITTYPE
21XXXX123411110123234567344547764READYTYPE3634643WIRELESSPERMITTYPE567
22XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481VBAREADYTYPE3634643WIRELESSPERMITTYPE8
23XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481READYTYPE3634643WIRELESSPERMITTYPE566
24XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESS
25XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE566
26XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547READYTYPE3634643WIRELESSPERMITTYPE566
27XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE566
28XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE566
29XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE566
30XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE566
31XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE566
32XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE566
33XXXX123411110123234567344547764WIRELESSREADYTRANSFER1223481WIRELESSPERMITPULL6547VBAREADYTYPE3634643WIRELESSPERMITTYPE566
Sheet1


REQUIRED OUTPUT REPORT
Book1
ABCDEFGHIJKL
1Work TypeM W 0#M P O#C WO#CPO3P NUMTICKET NUMCUSTOMER COL 1READY/PERMIT 1TYPE 1SM 1QUANTITY 1
2Work TypeM W 0#M P O#C WO#CPO4P NUMTICKET NUMCUSTOMER COL 2READY/PERMIT 2TYPE 2SM 2QUANTITY 2
3Work TypeM W 0#M P O#C WO#CPO5P NUMTICKET NUMCUSTOMER COL 3READY/PERMIT 3TYPE 3SM 3QUANTITY 3
4Work TypeM W 0#M P O#C WO#CPO6P NUMTICKET NUMCUSTOMER COL 4READY/PERMIT 4TYPE 4SM 4QUANTITY 4
5Work TypeM W 0#M P O#C WO#CPO7P NUMTICKET NUMCUSTOMER COL 5READY/PERMIT 5TYPE 5SM 5QUANTITY 5
6Work TypeM W 0#M P O#C WO#CPO8P NUMTICKET NUMCUSTOMER COL 6READY/PERMIT 6TYPE 6SM 6QUANTITY 6
7Work TypeM W 0#M P O#C WO#CPO9P NUMTICKET NUMCUSTOMER COL 7READY/PERMIT 7TYPE 7SM 7QUANTITY 7
8Work TypeM W 0#M P O#C WO#CPO10P NUMTICKET NUMCUSTOMER COL 8READY/PERMIT 8TYPE 8SM 8QUANTITY 8
9Work TypeM W 0#M P O#C WO#CPO11P NUMTICKET NUMCUSTOMER COL 9READY/PERMIT 9TYPE 9SM 9QUANTITY 9
10Work TypeM W 0#M P O#C WO#CPO12P NUMTICKET NUMCUSTOMER COL 10READY/PERMIT 10TYPE 10SM 10QUANTITY 10
11Work TypeM W 0#M P O#C WO#CPO13P NUMTICKET NUMCUSTOMER COL 11READY/PERMIT 11TYPE 11SM 11QUANTITY 11
12Work TypeM W 0#M P O#C WO#CPO14P NUMTICKET NUMCUSTOMER COL 12READY/PERMIT 12TYPE 12SM 12QUANTITY 12
13Work TypeM W 0#M P O#C WO#CPO15P NUMTICKET NUMCUSTOMER COL 13READY/PERMIT 13TYPE 13SM 13QUANTITY 13
14Work TypeM W 0#M P O#C WO#CPO16P NUMTICKET NUMCUSTOMER COL 14READY/PERMIT 14TYPE 14SM 14QUANTITY 14
15Work TypeM W 0#M P O#C WO#CPO17P NUMTICKET NUMCUSTOMER COL 15READY/PERMIT 15TYPE 15SM 15QUANTITY 15
16Work TypeM W 0#M P O#C WO#CPO18P NUMTICKET NUMCUSTOMER COL 16READY/PERMIT 16TYPE 16SM 16QUANTITY 16
17Work TypeM W 0#M P O#C WO#CPO19P NUMTICKET NUMCUSTOMER COL 17READY/PERMIT 17TYPE 17SM 17QUANTITY 17
18Work TypeM W 0#M P O#C WO#CPO20P NUMTICKET NUMCUSTOMER COL 18READY/PERMIT 18TYPE 18SM 18QUANTITY 18
19Work TypeM W 0#M P O#C WO#CPO21P NUMTICKET NUMCUSTOMER COL 19READY/PERMIT 19TYPE 19SM 19QUANTITY 19
20Work TypeM W 0#M P O#C WO#CPO22P NUMTICKET NUMCUSTOMER COL 20READY/PERMIT 20TYPE 20SM 20QUANTITY 20
21Work TypeM W 0#M P O#C WO#CPO23P NUMTICKET NUMCUSTOMER COL 21READY/PERMIT 21TYPE 21SM 21QUANTITY 21
22Work TypeM W 0#M P O#C WO#CPO24P NUMTICKET NUMCUSTOMER COL 22READY/PERMIT 22TYPE 22SM 22QUANTITY 22
23Work TypeM W 0#M P O#C WO#CPO25P NUMTICKET NUMCUSTOMER COL 23READY/PERMIT 23TYPE 23SM 23QUANTITY 23
24Work TypeM W 0#M P O#C WO#CPO26P NUMTICKET NUMCUSTOMER COL 24READY/PERMIT 24TYPE 24SM 24QUANTITY 24
25Work TypeM W 0#M P O#C WO#CPO27P NUMTICKET NUMCUSTOMER COL 25READY/PERMIT 25TYPE 25SM 25QUANTITY 25
26Work TypeM W 0#M P O#C WO#CPO28P NUMTICKET NUMCUSTOMER COL 26READY/PERMIT 26TYPE 26SM 26QUANTITY 26
27Work TypeM W 0#M P O#C WO#CPO29P NUMTICKET NUMCUSTOMER COL 27READY/PERMIT 27TYPE 27SM 27QUANTITY 27
28Work TypeM W 0#M P O#C WO#CPO30P NUMTICKET NUMCUSTOMER COL 28READY/PERMIT 28TYPE 28SM 28QUANTITY 28
29Work TypeM W 0#M P O#C WO#CPO31P NUMTICKET NUMCUSTOMER COL 29READY/PERMIT 29TYPE 29SM 29QUANTITY 29
Sheet2
 
Upvote 0
With your output, only row 1 of raw data (header) is repeated
How about row 2 to 33 of raw data?
I doubt that you want to dupplicate row 2 for n customers ( n * 5 rows), then row 3 , then row 4,...
Is it correct?
 
Upvote 0
With your output, only row 1 of raw data (header) is repeated
How about row 2 to 33 of raw data?
I doubt that you want to dupplicate row 2 for n customers ( n * 5 rows), then row 3 , then row 4,...
Is it correct?
Partially correct, in the raw data report columns A-G must remain in tact to go along with all customers in that same row. Except every 5 columns, there is new customer and every column in the worksheet contains new customer data. The data in A-G will need to be duplicated 40 times(40 new customer columns) to convert the columns into rows but remain in tact.

For some reason the raw report expands to new columns instead of continuing continuing down in rows.

Did that answer your question?
 
Upvote 0
I too, am a little confused. Given the raw data that you posted in your Post #4, and looking only at Row 2 of that data, is this what your expected output would be. Also, the Header Row is a little confusing...

Split text.xlsm
ABCDEFGHIJKL
1Work TypeM W 0#M P O#C WO#CPO3P NUMTICKET NUMQUANTITY 1CUSTOMER COL 2 READY/PERMIT 2TYPE 2SM 2
2XXXX123111101232345673445477641JIMPERMITPULL35674
3XXXX123111101232345673445477641WIRELESS READYTYPE23566
4XXXX123111101232345673445477644562WIRELESSPERMITTYPE2353
Output


Also, what would you have done with the rows where blank cells are entwined in the Raw Data.
 
Upvote 0
I too, am a little confused. Given the raw data that you posted in your Post #4, and looking only at Row 2 of that data, is this what your expected output would be. Also, the Header Row is a little confusing...

Split text.xlsm
ABCDEFGHIJKL
1Work TypeM W 0#M P O#C WO#CPO3P NUMTICKET NUMQUANTITY 1CUSTOMER COL 2 READY/PERMIT 2TYPE 2SM 2
2XXXX123111101232345673445477641JIMPERMITPULL35674
3XXXX123111101232345673445477641WIRELESS READYTYPE23566
4XXXX123111101232345673445477644562WIRELESSPERMITTYPE2353
Output


Also, what would you have done with the rows where blank cells are entwined in the Raw Data.
Yes! This is exactly how I need to structure every row and customer in my worksheet! Any advice on how I achieve that? At the moment I am attempting to create dynamic arrays to add to an dictionary, but my dictionary output is outputting correctly.
 
Upvote 0
Can you tell me what the exact Header Row should look like. I would think that you would be dropping the numerical ending in at least Columns ("H", "I", "J") and possibly "K" and "L" as well.
 
Upvote 0
Can you tell me what the exact Header Row should look like. I would think that you would be dropping the numerical ending in at least Columns ("H", "I", "J") and possibly "K" and "L" as well.
Yes, here they are. Columns A-AP & IE-JG must apply to the customer's data in the adjacent columns in that row.
esri raw report.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAIAJAKALAMANAOAPAQARASATAUAVAWAXAYAZBABBBCBDBEBFBGBHBIBJBKBLBMBNBOBPBQBRBSBTBUBVBWBXBYBZCACBCCCDCECFCGCHCICJCKCLCMCNCOCPCQCRCSCTCUCVCWCXCYCZDADBDCDDDEDFDGDHDIDJDKDLDMDNDODPDQDRDSDTDUDVDWDXDYDZEAEBECEDEEEFEGEHEIEJEKELEMENEOEPEQERESETEUEVEWEXEYEZFAFBFCFDFEFFFGFHFIFJFKFLFMFNFOFPFQFRFSFTFUFVFWFXFYFZGAGBGCGDGEGFGGGHGIGJGKGLGMGNGOGPGQGRGSGTGUGVGWGXGYGZHAHBHCHDHEHFHGHHHIHJHKHLHMHNHOHPHQHRHSHTHUHVHWHXHYHZIAIBICIDIEIFIGIHIIIJIKILIMINIOIPIQIRISITIUIVIWIXIYIZJAJBJCJDJEJFJG
1OBJECTIDReceived DateWork TypeWork ReasonOffice CommentsService CenterLocationCircuit NameMap NumberCity / CountyDTE OriginatorO&M W.O. #O&M P.O. #Capital W.O. #Capital P.O. #GLN XGLN YPole NumberNJUNS Ticket NumberPreflight Assigned ToField Crew Assigned ToJob StatusLatitudeLongitudePlanner NamePole OwnerPole Owner (if 'Other')Available AccessMis DigMis Dig NotesTree TrimTree Trim NotesPole Tag ID - OldPole Tag ID - NewDTE Power Only on PolePreflight NotesIs Job Workable?Field ObservationsComms to Complete Own NotesWork Found CompletePreflight Inspection CompletePreflight DateCustomer 1Make Ready / Violation 1Work Type 1Service Master 1Quantity 1Customer 2Make Ready / Violation 2Work Type 2Service Master 2Quantity 2Customer 3Make Ready / Violation 3Work Type 3Service Master 3Quantity 3Customer 4Make Ready / Violation 4Work Type 4Service Master 4Quantity 4Customer 5Make Ready / Violation 5Work Type 5Service Master 5Quantity 5Customer 6Make Ready / Violation 6Work Type 6Service Master 6Quantity 6Customer 7Make Ready / Violation 7Work Type 7Service Master 7Quantity 7Customer 8Make Ready / Violation 8Work Type 8Service Master 8Quantity 8Customer 9Make Ready / Violation 9Work Type 9Service Master 9Quantity 9Customer 10Make Ready / Violation 10Work Type 10Service Master 10Quantity 10Customer 11Make Ready / Violation 11Work Type 11Service Master 11Quantity 11Customer 12Make Ready / Violation 12Work Type 12Service Master 12Quantity 12Customer 13Make Ready / Violation 13Work Type 13Service Master 13Quantity 13Customer 14Make Ready / Violation 14Work Type 14Service Master 14Quantity 14Customer 15Make Ready / Violation 15Work Type 15Service Master 15Quantity 15Customer 16Make Ready / Violation 16Work Type 16Service Master 16Quantity 16Customer 17Make Ready / Violation 17Work Type 17Service Master 17Quantity 17Customer 18Make Ready / Violation 18Work Type 18Service Master 18QuantityCustomer 19Make Ready / Violation 19Work Type 19Service Master 19Quantity 19Customer 20Make Ready / Violation 20Work Type 20Service Master 20Quantity 20Customer 21Make Ready / Violation 21Work Type 21Service Master 21Quantity 21Customer 22Make Ready / Violation 22Work Type 22Service Master 22Quantity 22Customer 23Make Ready / Violation 23Work Type 23Service Master 23Quantity 23Customer 24Make Ready / Violation 24Work Type 24Service Master 24Quantity 24Customer 25Make Ready / Violation 25Work Type 25Service MasterQuantity 25Customer 26Make Ready / Violation 26Work Type 26Service Master 26Quantity 26Customer 27Make Ready / Violation 27Work Type 27Service Master 27Quantity 27Customer 28Make Ready / Violation 28Work Type 28Service Master 28Quantity 28Customer 29Make Ready / Violation 29Work Type 29Service Master 29Quantity 29Customer 30Make Ready / Violation 30Work Type 30Service Master 30Quantity 30Customer 31Make Ready / Violation 31Work Type 31Service Master 31Quantity 31Customer 32Make Ready / Violation 32Work Type 32Service Master 32Quantity 32Customer 33Make Ready / Violation 33Work Type 33Service Master 33Quantity 33Customer 34Make Ready / Violation 34Work Type 34Service Master 34Quantity 34Customer 35Make Ready / Violation 35Work Type 35Service Master 35Quantity 35Customer 36Make Ready / Violation 36Work Type 36Service Master 36Quantity 36Customer 37Make Ready / Violation 37Work Type 37Service Master 37Quantity 37Customer 38Make Ready / Violation 38Work Type 38Service Master 38Quantity 38Customer 39Make Ready / Violation 39Work Type 39Service Master 39Quantity 39Customer 40Make Ready / Violation 40Work Type 40Service Master 40Quantity 40Crew ForemanCrew Member 1Crew Member 2Crew Member 3Crew Member 4Crew Member 5Crew Member 6Crew MinutesExplanationField Crew NotesWork CompleteWork Complete DatePreflight CustomerPreflight QuantityPreflight CodeNJUNS CustomerNJUNS QuantityNJUNS CodeGlobalIDcreated_usercreated_datelast_edited_userlast_edited_datexy
Sheet2
 
Upvote 0

Forum statistics

Threads
1,214,413
Messages
6,119,372
Members
448,888
Latest member
Arle8907

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