cav~firez22
Well-known Member
- Joined
- Jun 21, 2006
- Messages
- 543
Is there a Macro, or formula that will sort a spread sheed by colour of cell?
Is there a Macro, or formula that will sort a spread sheed by colour of cell?
Option Explicit
Sub sort_by_color()
'Erik Van Geit
'060625
Const col = 3
Application.ScreenUpdating = False
ThisWorkbook.Names.Add Name:="Color", RefersToR1C1:="=GET.CELL(63,!RC[" & col & "])"
With Worksheets(1)
.Columns(1).Insert
With .Range(.Cells(1, 1), .Cells(.Cells(.Rows.Count, col + 1).End(xlUp).Row, 1))
.Formula = "=Color"
.Resize(.Rows.Count, Columns.Count).Sort key1:=.Cells(1, 1)
End With
.Columns(1).Delete
End With
ThisWorkbook.Names("Color").Delete
Application.ScreenUpdating = True
End Sub