peraphs impossible... order line base color...

S

sal21

Is possible to order line in sheet based 2 key, color in column AF and
value in column AE????

In column AF to have many cells with value colourindex=3 (red)
And in column AE have only number.
I want to order by first key the value colored in AF and second key
value in AE...
The range is A5:AF150
 
J

JLGWhiz

You cannot do it using the sort method, since VBA will not automatically read
the color index as data. It is possible to write code that would sort the
colors by color index, but I personally see no value to it when other more
simple means are available.
 
J

Joel

One methode is to create your own VBA function like below

Function getcolor(target As Range)

getcolor = target.Interior.ColorIndex
End Function

call on worksheet with
=getcolor(AF5)

Add the function to an auxilary column. Then sort using the new auxilary
column.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top