If you want to sort or arrange the data on the basis of background color.Snapshot Below-
Here is the code-
Sub sort_on_background_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 filled 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).Interior.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 Background Color. Show all posts
Showing posts with label Sort Data on the basis of Background 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...
-
If you want to run SQL queries within Excel environment without connecting to any database, you can do it with creating the ADODB conn...
-
Macro to send b'day message automatically Snapshot of email: Snapshot of data: Method 1 Add image using web lin...