a = 1
iSection = 1
For
j = 1
To
colMax
If
Not
Cells(1, j).Interior.ColorIndex = Worksheets(1).Cells(1, j + 1).Interior.ColorIndex
Then
Do
Until
iSection = 3
For
k = a
To
j
Range(Cells(2, k), Cells(iRowMax, k)).
Select
If
Range(Cells(2, k), Cells(iRowMax, k)) <>
""
Then
<strong>Range(Cells(2, a), Cells(iRowMax, a)) = Range(Cells(2, a), Cells(iRowMax, a)) & Range(Cells(2, k), Cells(iRowMax, k))</strong>
End
If
Next
a = j
iSection = iSection + 1
Loop
End
If
Next