View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default Creating a macro that pulls rows by the color

This selects rows by testing column A for "blue" (colorindex=41) and copies
rows to new worksheet, starting in row 2.

Sub MoveRowsByColour()

Dim rngA As Range

With Worksheets("sheet1") ' Original source
Set rngA = Range(.Cells(1, 1), .Cells(Rows.Count, 1).End(xlUp))
End With

For Each cell In rngA
If cell.Interior.ColorIndex = 41 Then
cell.EntireRow.Copy _
Destination:=Sheets("Under
Development").Range("A65536").End(xlUp).Offset(1, 0)

End If
Next

End Sub

"Aria" wrote:

I have a spreadsheet that has data and each row is color coded to reflect a
status. I would like to create a macro that groups each color category
together in a separate worksheet.

For instance: Blue = Under Development. I created a worksheet called "Under
Development" and instead of having to manually scroll through the entire
original worksheet and copy each Blue row, I want the macro to do it for me,
and insert these rows (according to color - in this case, BLUE) in the new
worksheet, "Under Development"

Can anyone help?

Thanks,