Option Explicit
Private Function Ind(chn$) As Byte
Dim c As String * 1: c = Left$(chn, 1): Ind = 4 - (c = "R")
End Function
Sub Essai()
If ActiveSheet.Name <> "ExportDetailsRetailes_2021-04-0" Then Exit Sub
Dim n&: n = Cells(Rows.Count, 1).End(3).Row: If n = 1 Then Exit Sub
Dim T, chn$, z As Byte, t1, t2, v1#, v2#, s#, i&
n = n - 1: T = [A2].Resize(n, 5): Application.ScreenUpdating = 0
i = Cells(Rows.Count, 3).End(3).Row: If i > 1 Then Range("C2:E" & i).ClearContents
For i = 1 To n
chn = T(i, 1)
If chn <> "" Then
z = -(InStr(chn, vbLf) > 0)
If z = 0 Then
v1 = T(i, 2): If v1 > 0 Then T(i, 3) = v1: T(i, Ind(chn)) = v1
Else
t1 = Split(chn, vbLf): t2 = Split(T(i, 2), vbLf)
v1 = t2(0): If v1 > 0 Then chn = t1(0): T(i, Ind(chn)) = v1
v2 = t2(1): If v2 > 0 Then chn = t1(1): T(i, Ind(chn)) = v2
s = v1 + v2: If s > 0 Then T(i, 3) = s
End If
End If
Next i
[A2].Resize(n, 5) = T
End Sub