Saturday, January 21, 2012

VBA Data Sort Using Font Color

!.....VBA Program to Sort Data by Font Color.....!

Sub Sort_by_FontColor()
Application.ScreenUpdating = 0
Columns("b").Insert
For i = 2 To Range("a65536").End(xlUp).Row
Cells(1, 2) = "Color Index"
Cells(i, 2) = Cells(i, 1).Font.ColorIndex
Next
Range("a2:" & Chr(64 + Cells(1, 1).End(xlToRight).Column) & Range("A1").End(xlDown).Row).Sort Range("b2"), xlAscending
Columns("b").Delete
End Sub

No comments:

Post a Comment

Excel VBA to send email from excel with HTML table in a email body

'' Excel vba script to send email from outlook & email body in HTML table format. ''Write down email body in HTML tags...