Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default can I sort colored cells?

Hi,
Can I sort a column that some cells are colored "red" and and some "yellow"
in the nearby columns seperately via VBA?. Please provide a sample code that
does the job. Thank you for your time.
JACK


  #2   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default can I sort colored cells?

Yes !
with this code (paste in a module VBA)

Function MyColor(CkCell As Object)
Application.Volatile True
MyColor = Abs(CkCell.Interior.ColorIndex) ' not for the conditionnal color
!!!
End Function

In a différent colum, you type = mycolor(A1)
and you sort by this nex column

Bye


--
....Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel

"Jack" a écrit dans le message de
...
Hi,
Can I sort a column that some cells are colored "red" and and some

"yellow"
in the nearby columns seperately via VBA?. Please provide a sample code

that
does the job. Thank you for your time.
JACK




  #3   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default can I sort colored cells?

each color have a number 6 = yellow, 3 = red , etc....
look in the help
If you sort on the B column, the A column is sorted too...

Bye

Sorry for my poor english, i live in Belgium :-))


--
....Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel

"Jack" a écrit dans le message de
...
Thanks Patrick,
I have tried your function on a dummy list, filled A1 with red and another
cell too. Then I entered the formula =mycolor(A1) to B1 but get a number

(3)
there which I have no idea what it means. But I needed to display only
thouse red cells with content in the nearby seperate column.
Regards

"...Patrick" <http://cerbermail.com/?KPW0tTCjFw wrote in message
...
Yes !
with this code (paste in a module VBA)

Function MyColor(CkCell As Object)
Application.Volatile True
MyColor = Abs(CkCell.Interior.ColorIndex) ' not for the conditionnal

color
!!!
End Function

In a différent colum, you type = mycolor(A1)
and you sort by this nex column

Bye


--
...Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel

"Jack" a écrit dans le message de
...
Hi,
Can I sort a column that some cells are colored "red" and and some

"yellow"
in the nearby columns seperately via VBA?. Please provide a sample

code
that
does the job. Thank you for your time.
JACK








  #4   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default can I sort colored cells?

Thanks Patrick,
I have tried your function on a dummy list, filled A1 with red and another
cell too. Then I entered the formula =mycolor(A1) to B1 but get a number (3)
there which I have no idea what it means. But I needed to display only
thouse red cells with content in the nearby seperate column.
Regards

"...Patrick" <http://cerbermail.com/?KPW0tTCjFw wrote in message
...
Yes !
with this code (paste in a module VBA)

Function MyColor(CkCell As Object)
Application.Volatile True
MyColor = Abs(CkCell.Interior.ColorIndex) ' not for the conditionnal

color
!!!
End Function

In a différent colum, you type = mycolor(A1)
and you sort by this nex column

Bye


--
...Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel

"Jack" a écrit dans le message de
...
Hi,
Can I sort a column that some cells are colored "red" and and some

"yellow"
in the nearby columns seperately via VBA?. Please provide a sample code

that
does the job. Thank you for your time.
JACK






  #5   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default can I sort colored cells?

Thanks Patrick,
The explanation was short and clear.
No problem with your English too.
Sincerely

"...Patrick" <http://cerbermail.com/?KPW0tTCjFw wrote in message
...
each color have a number 6 = yellow, 3 = red , etc....
look in the help
If you sort on the B column, the A column is sorted too...

Bye

Sorry for my poor english, i live in Belgium :-))


--
...Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel

"Jack" a écrit dans le message de
...
Thanks Patrick,
I have tried your function on a dummy list, filled A1 with red and

another
cell too. Then I entered the formula =mycolor(A1) to B1 but get a number

(3)
there which I have no idea what it means. But I needed to display only
thouse red cells with content in the nearby seperate column.
Regards

"...Patrick" <http://cerbermail.com/?KPW0tTCjFw wrote in message
...
Yes !
with this code (paste in a module VBA)

Function MyColor(CkCell As Object)
Application.Volatile True
MyColor = Abs(CkCell.Interior.ColorIndex) ' not for the conditionnal

color
!!!
End Function

In a différent colum, you type = mycolor(A1)
and you sort by this nex column

Bye


--
...Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel

"Jack" a écrit dans le message de
...
Hi,
Can I sort a column that some cells are colored "red" and and some
"yellow"
in the nearby columns seperately via VBA?. Please provide a sample

code
that
does the job. Thank you for your time.
JACK












  #6   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default can I sort colored cells?

you are welcome :-))

Bye

"Jack" a écrit dans le message de
...
Thanks Patrick,
The explanation was short and clear.
No problem with your English too.
Sincerely

"...Patrick" <http://cerbermail.com/?KPW0tTCjFw wrote in message
...
each color have a number 6 = yellow, 3 = red , etc....
look in the help
If you sort on the B column, the A column is sorted too...

Bye

Sorry for my poor english, i live in Belgium :-))


--
...Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel

"Jack" a écrit dans le message de
...
Thanks Patrick,
I have tried your function on a dummy list, filled A1 with red and

another
cell too. Then I entered the formula =mycolor(A1) to B1 but get a

number
(3)
there which I have no idea what it means. But I needed to display only
thouse red cells with content in the nearby seperate column.
Regards

"...Patrick" <http://cerbermail.com/?KPW0tTCjFw wrote in message
...
Yes !
with this code (paste in a module VBA)

Function MyColor(CkCell As Object)
Application.Volatile True
MyColor = Abs(CkCell.Interior.ColorIndex) ' not for the

conditionnal
color
!!!
End Function

In a différent colum, you type = mycolor(A1)
and you sort by this nex column

Bye


--
...Patrick
Quoi que vous fassiez, faites le bien .
Mail: http://cerbermail.com/?KPW0tTCjFw
Connectez vous sur ce forum par :
news://msnews.microsoft.com/microsoft.public.fr.excel

"Jack" a écrit dans le message de
...
Hi,
Can I sort a column that some cells are colored "red" and and some
"yellow"
in the nearby columns seperately via VBA?. Please provide a sample

code
that
does the job. Thank you for your time.
JACK












Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
colored cells kayr Excel Discussion (Misc queries) 2 August 26th 09 09:01 PM
How to sort colored data Bob Excel Discussion (Misc queries) 2 September 24th 05 12:35 AM
Can you sort a column in Excel that's different by colored font? JHoleman1 Excel Worksheet Functions 1 August 20th 05 03:37 AM
sort according to the colored rows swchee Excel Discussion (Misc queries) 2 August 18th 05 04:07 AM
Cell right next to colored cells is automatically colored on entering a value Johan De Schutter Excel Programming 6 September 12th 03 05:31 PM


All times are GMT +1. The time now is 04:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"