Try this:
Sub test()
a = 1
b = 1
For Each cell In Range("B1:B100")
Select Case cell.Interior.ColorIndex
Case Is = 3
Range(cell.Offset(, -1), cell.Resize(, 5)).Copy _
Sheets(2).Cells(a, 1)
a = a + 1
Case Is = 37
Range(cell.Offset(, -1), cell.Resize(, 5)).Copy _
Sheets(3).Cells(b, 1)
b = b + 1
End Select
Next cell
End Sub
--
Dan
On Dec 13, 4:05 pm, K <kamranr1...@yahoo.co.uk> wrote:
> Hi, can anybody please able to tell me the macro that how can i copy
> rows to another sheet on based on cell colour. Like if i have
> "Interior.Colorindex = 3" or Red in cell B1,B3 and B7 so how can i
> copy those colored rows which should be not entire row but from Cell
> A
> to Cell F in length to any other sheet. Please anybody can help it
> will be very helpful.... Thanks
|