Put Set rng = rng.Offset(1) after End If and before Next j so the row offsets for each j regardless if D is empty.
Alternatively, offset the column .Values from rngCode as that is the current column D cell.![]()
rng.Offset(0, 12).Value = nodes(nd + 1).Attributes(1).Value End If Set rng = rng.Offset(1) Next j End With
Bookmarks