If you want to sort or arrange the data on the basis of font color. Snapshot Below-
Sub sort_on_font_color()
Dim i As Long
' we will ADD Temp data to Col B and find the color index of all cells of columm a and , after that
' we will sort the data on the basis of color index and then we will delte all the temp data of col B
Sheets(1).Range("b1").Value = "Color Index"
' first we will get the color index for all the font colors of cells of cOL A IN Col B
For i = 2 To Sheets(1).Range("a1").End(xlDown).Row
Sheets(1).Cells(i, 2).Value = Sheets(1).Cells(i, 1).Font.ColorIndex
Next i
Sheets(1).Range("a1:b" & Range("a1").End(xlDown).Row).Sort key1:=Sheets(1).Range("b:b"), order1:=xlAscending, Header:=xlYes
Sheets(1).Columns("b:b").Delete
Sheets(1).Cells(1, 1).Select
End Sub
Download Excel Macro File
Showing posts with label Sort Data on the basis of Font Color. Show all posts
Showing posts with label Sort Data on the basis of Font Color. Show all posts
Subscribe to:
Posts (Atom)
Import data from SQL
Macro to import data from SQL using ADO connection string: Sub Import_data_from_SQL() ' Tools -> References -> Microsoft Active...
-
Macro to Export Range in Json Format Option Explicit Sub export_in_json_format() Dim fs As Object Dim jsonfile Dim rangetoex...
-
If you want to run SQL queries within Excel environment without connecting to any database, you can do it with creating the ADODB conn...