All data from one cell to other rows and columns

ccgbalarin

New Member
Joined
Nov 18, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi everyone!



I created a purchase order request from Jotform, but when I download the Excel file, all the information from the products come in one cell.

thumbnail image 1 captioned first excel file


I need the information to be allocated on separated columns and rows (example in the image below).

I've tried using the replace tool + text to columns but it doesn't work for me, it only register one paragraph from the text I receive. It is important to notice that the different products are separated by paragraphs (by pressing Enter).

This is the ideal layout for me:

thumbnail image 2 captioned what would be perfect


(if we could "merge&center" the empty cells would be nice, but not needed)

If I'm able to achieve this, I can use "Text to Columns" to look like this:

thumbnail image 3 captioned after text to columns


And this is the end result I want.



It needs to be done automatically for me (Macro and/or VBA), because this file keeps updating after 15 days.



Any ideas on how to do this?



Thanks in advance,

Caio

rawfile_purchaseorderform.xlsx
ABCDEFG
1Submission DateApproval StatusIdentificação ÚnicaNomeSobrenomeE-mailItens
22021/11/18 10:08:39AprovadoP-00003iannepomniachtchinepo@gmail.comPincel Hidrográfico Compactor (Amount: 0.00 BRL, Quantidade: 6) Papel Celofane (Amount: 0.00 BRL, Quantidade: 2, Cor: Azul Escuro) Papel Celofane (Amount: 0.00 BRL, Quantidade: 3, Cor: Laranja) Envelope Comercial (Amount: 0.00 BRL, Tipo: Com CEP, Quantidade: 1) Etiqueta (Amount: 0.00 BRL, Por Folha: 16 unidades, Quantidade: 2) Placa EVA Glitter (Amount: 0.00 BRL, Quantidade: 3, Cor: Azul Escuro) Placa EVA Glitter (Amount: 0.00 BRL, Quantidade: 4, Cor: Branco) Placa EVA Glitter (Amount: 0.00 BRL, Quantidade: 6, Cor: Rosa) Lantejoula Tubo (Amount: 0.00 BRL, Quantidade: 5, Cor: Vermelho, Tamanho: Pequena) Lantejoula Tubo (Amount: 0.00 BRL, Quantidade: 2, Cor: Verde Claro, Tamanho: Pequena) Total: 0.00 BRL
32021/11/11 14:17:18AprovadoP-00001caiocaiocaio@caio.comMarca Texto (Amount: 0.00 BRL, Quantidade: 1, Cor: Amarelo) Marca Texto (Amount: 0.00 BRL, Quantidade: 2, Cor: Rosa) Tinta para Reabastecimento de Pincel (Amount: 0.00 BRL, Quantidade: 2, : Vermelho) Total: 0.00 BRL
Sheet1
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Try this code. You will need to select the first cell with data to split (in the case of your example it would be G2), then simply run the macro. It will run through all rows below it until it hits an empty row.

As always I tell people to try it on a sample set or a copy of the file so as not to lose your data.

If there is anything you would like me to change, let me know.

VBA Code:
Sub Split()
    Dim sheet As Worksheet
    Dim cell As Range
    Dim Text As String
    Dim count As Integer
    Dim nextcell As Range
    Dim cutoff As Boolean
    Dim curCell As Range
    
    Set sheet = ThisWorkbook.ActiveSheet
    Set cell = Application.ActiveCell
    
    'Set Currently Used Cell
    Set curCell = Cells(cell.Row, cell.Column)
    
    'Check if there are multiple rows to process
    If Cells(cell.Row + 1, cell.Column).Value <> "" Then
        Set nextcell = curCell.Offset(1)
        cutoff = False
    Else
        cutoff = True
    End If
    
    'Main Loop
    For x = cell.Row To cell.End(xlDown).Row
        Text = curCell.Value
        count = Len(Text) - Len(Replace(Text, ")", ""))
        For i = 1 To count
            If i < count Then
                Rows(curCell.Offset(i).Row).Insert
            End If
            curCell.Offset(i - 1).Value = Left(Text, InStr(Text, ")"))
            Text = Right(Text, Len(Text) - InStr(Text, ")"))
        Next i
        'Mov
        If cutoff = False Then
            Set curCell = nextcell
            Set nextcell = nextcell.Offset(1)
        End If
    Next x
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,917
Members
449,093
Latest member
dbomb1414

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