Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Creating a macro that pulls rows by the color

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,
  #2   Report Post  
Posted to microsoft.public.excel.programming
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,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Creating a macro that pulls rows by the color

See Bob's site Aria
http://www.xldynamic.com/source/xld.ColourCounter.html


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Aria" wrote in message ...
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,



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make text color match cell color with macro? JoeSpareBedroom Excel Discussion (Misc queries) 1 June 26th 07 07:09 PM
Creating a Macro For Shading Rows - Or Should I Use Conditional Formatting? [email protected] Excel Worksheet Functions 3 May 3rd 07 11:41 PM
How do I sort my data by color? (color applied to rows) TTownsend Excel Worksheet Functions 3 September 7th 06 09:49 PM
How do I create a macro that pulls stock prices from a website? Mikey Excel Discussion (Misc queries) 1 July 19th 06 11:56 PM
Creating a macro commad to shift selected rows to the right next c Shifting of Multiple Row to the right Excel Discussion (Misc queries) 1 September 15th 05 03:31 AM


All times are GMT +1. The time now is 06:35 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"