13.11.2019, 12:43
so?
Code:
Sub F_en()
lr = Cells(Rows.Count, 2).End(xlUp).Row
For i = 2 To lr
If Len(Cells(i, 3)) < 5 Then
Out = "ABCDEFGHI-" & Cells(i, 3)
Else
Out = "C0000" & Cells(i, 3)
End If
Cells(i, "G") = Out
If Cells(i, 1) = "" Then
Cells(i, "F") = Cells(i, 2)
'Cells(i, "G") = "ABCDEFGHI-" & Format(Cells(i, 3), "0000")
Else
Cells(i, "F") = "TBA-" & Cells(i, 1) & "-" & Format(Cells(i, 2), "0000")
'Cells(i, "G") = "C0000" & Cells(i, 3)
End If
Next i
End Sub