How can I tabulate a bulk file?

0

Hello, I have a file of 64500 rows and 11 columns to tabulate. The original file came from the counter system, which is a system for printing paper. I've been able to get the headers out, but I'm having trouble with the tab. Does anyone know of a tool or method that recognizes when the line is correct and when it is not?

When you do not need to delete two tabs, it returns to normal. This error occurs 7122 times in my file. The file has 1050 pages for printing and I also need to remove 6 lines on each page. Can someone help me? I thought about replacing the tab by commas to create a CSV but I could not.

    
asked by anonymous 17.04.2018 / 23:23

1 answer

0

You can use this code to correct tab stops:

Sub FixTabs()

Dim i, j, lastRow As Long

lastRow = Range("A1").End(xlDown).Row 'Contagem total de linhas

j = 1
For i = 1 To lastRow
    Do While Range("C" & i).Value = "" 'Substitua "C" pela coluna correspondente C/P
        Range("C" & i, "D" & i).Delete Shift:=xlToLeft '*Ajustar colunas a serem excluídas
        j = j + 1 'iterador para sair do loop
        If j = lastRow Then
            i = j
            GoTo continue 'pular linhas de código
        End If
    Loop
continue:
Next i
End Sub

* Use F8 to run step by step and verify that the code deletes the correct cells

    
18.04.2018 / 18:56