Sub xx() Const t = 2 a = String(t, "X") With Sheets("sheet1") For i = 5 To 10 k = 13 For j = 8 To 16 If .Cells(j, i).Interior.ColorIndex = xlNone Then Sheets("sheet2").Cells(k, i + 5) = a & .Cells(j, i) k = k + 1 End If Next Next End WithEnd Sub