c = 0 c0 = rngRow.Cells.Count For Each rngCell In rngRow.Cells c = c + 1 sCell = rngCell.Text (...) 'Add opening and closing cell tags If c < c0 Then sCell = sCell & "|" End If