Hello. I'm trying to format a table to base a graph, however I'm getting the following error message: "run-time error '1004': application-defined or object-defined error"
I'm using the following macro. Does something know the reason for the error? The error occurs on the line that > > > < <
Sub Botão_ReplicadorColuna()
Dim i, j, UltimaLinha, UltimaColuna As Long
UltimaLinha = 1000000
UltimaColuna = 30
Application.ScreenUpdating = False
For j = 4 To UltimaColuna
For i = UltimaLinha To 1 Step -1
If Cells(i, j).Value <> "" Then
Cells(i + 1, 2).EntireRow.Insert
Cells(i + 1, 1).Value = Cells(i, 1).Value
>>>>Cells(i + 1, 2).Value = Cells(i, 2).Value<<<<
Cells(i + 1, 3).Value = Cells(i, j).Value
Cells(i, j).Value = ClearContents
End If
Next
Next
Application.ScreenUpdating = True
Range("A1").Select
End Sub
I have two spreadsheets. One where the macro is and another where I did a data processing and then copied from it and pasted it into the macro worksheet.
There are no merged cells.
I noticed that up to 100000 lines the macro works perfectly. After that the error is displayed.
What I want to do is the following. I want to replicate the id and content for each existing theme column, so that a row is made up of only three columns.
**Original:**
ID / Content / Theme
1 / words / theme/ theme2/ theme3
2 / words / theme/ them2
3 / words / theme
**Pós-macro:**
ID / Content / Theme
1 / words / theme
1 / words / theme2
1 / words / theme3
2 / words / theme
2 / words / theme2
3 / words / theme