Sorting a spreadsheet by color
So I was given an internal cleanup project that had a spreadsheet of 500 items that needed to be reviewed and acted on. As I worked through the list over the course of a couple of weeks, I color-coded the items based on the next action to take (follow up, merge, close, etc). At the end of the project I wanted to sort the spreadsheet by color, only to discover that Excel can't do this! Well, being the curious sort I started exploring the option of doing it with a VBA macro. Using a combination of web searches and help files, I put this macro together:
Sub ColorSort()
Dim ColorValue
Dim LastRow
Dim LastColumn
LastRow = Cells.Find(What:="*", After:=[A1], SearchDirection:=xlPrevious).Row
LastColumn = Cells.Find(What:="*", After:=[A1], SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
For i = 2 To LastRow
ColorValue = Cells(i, LastColumn).Offset(0, -1).Interior.ColorIndex
Cells(i, LastColumn).Value = ColorValue
Next i
End Sub
You just need to create a column at the end of your worksheet and call it "Color" or something like that. Next, run the macro; it assigns a number based on the background color of the row. You can then sort the worksheet by the "Color" column, and voila!
While this isn't directly Patron Edge or Patron Edge Online related, it has become such a great tool for me I thought some of you might find it helpful as well. Maybe you've had an event get cancelled and you get a phone list through Marketing Mailing that someone is color-coding. Maybe you are using the Raiser's Edge export module and working with a spreadsheet it kicked out. Or maybe you're doing something completely non-work-related and you find a use for this. If this macro helps you save some time, leave a comment for others to see!