Veja se é isso:
Sub Coloridas()
Dim slin As Integer
Dim elin As Integer
Dim col As Integer
Dim v As Boolean
slin = 4
elin = 15
flin = elin - 2
col = 3
Call Limpar
Do While slin < flin
Do While col <= 5
If Cells(slin, col).Interior.ColorIndex <> xlNone Then
v = True
Cells(slin, col).Copy
Cells(elin, col).Select
ActiveSheet.Paste
Cells(slin, 2).Copy
Cells(elin, 2).Select
ActiveSheet.Paste
col = col + 1
Else
col = col + 1
End If
Loop
col = 3
slin = slin + 1
If v = True Then
elin = elin + 1
End If
v = False
Loop
Application.CutCopyMode = False
End Sub
Sub Limpar()
With Range("B15:E100")
.Borders(xlEdgeLeft).LineStyle = xlNone
.Borders(xlEdgeTop).LineStyle = xlNone
.Borders(xlEdgeBottom).LineStyle = xlNone
.Borders(xlEdgeRight).LineStyle = xlNone
.Borders(xlInsideVertical).LineStyle = xlNone
.Borders(xlInsideHorizontal).LineStyle = xlNone
.Interior.ColorIndex = xlNone
.ClearContents
End With
End Sub
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 07/06/2013 10:52 am