あなたの説明によると、これはあなたが望むことを行うはずです。
Option Explicit
'Qual coluna possui os termos que repetem?
Const ANALYSIS_ROW1 As String = "I"
Const ANALYSIS_ROW2 As String = "M"
'Em qual linha começam os dados?
Const DATA_START_ROW As Long = 2
Sub ReplicateData()
Dim iRow As Long
Dim LastRow As Long
Dim ws As Worksheet
Dim iSplit() As String
Dim iIndex As Long
Dim iSize As Long
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
With ThisWorkbook
.Worksheets("Sheet1").Copy After:=.Worksheets("Sheet1")
Set ws = ActiveSheet
End With
With ws
LastRow = .Cells(.Rows.Count, ANALYSIS_ROW1).End(xlUp).Row
End With
For iRow = LastRow To DATA_START_ROW Step -1
iSplit = Split(ws.Cells(iRow, ANALYSIS_ROW1).Value2, ";")
iSplit = Split(ws.Cells(iRow, ANALYSIS_ROW2).Value2, ";")
iSize = UBound(iSplit) - LBound(iSplit) + 1
If iSize = 1 Then GoTo Continue
ws.Rows(iRow).Copy
ws.Rows(iRow).Resize(iSize - 1).Insert
For iIndex = LBound(iSplit) To UBound(iSplit)
ws.Cells(iRow, ANALYSIS_ROW1).Offset(iIndex).Value2 = iSplit(iIndex)
ws.Cells(iRow, ANALYSIS_ROW2).Offset(iIndex).Value2 = iSplit(iIndex)
Next iIndex
Continue:
Next iRow
Application.CutCopyMode = False
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub
これは完全に機能しました。ありがとう – Matt