PC Review


Reply
Thread Tools Rate Thread

can I sort colored cells?

 
 
Jack
Guest
Posts: n/a
 
      31st Aug 2004
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 With Quote
 
 
 
 
...Patrick
Guest
Posts: n/a
 
      31st Aug 2004
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" <(E-Mail Removed)> a écrit dans le message de
news:(E-Mail Removed)...
> 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 With Quote
 
...Patrick
Guest
Posts: n/a
 
      31st Aug 2004
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" <(E-Mail Removed)> a écrit dans le message de
news:%23ms5H%(E-Mail Removed)...
> 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
> news:ub4%(E-Mail Removed)...
> > 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" <(E-Mail Removed)> a écrit dans le message de
> > news:(E-Mail Removed)...
> > > 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 With Quote
 
Jack
Guest
Posts: n/a
 
      31st Aug 2004
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
news:ub4%(E-Mail Removed)...
> 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" <(E-Mail Removed)> a écrit dans le message de
> news:(E-Mail Removed)...
> > 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 With Quote
 
Jack
Guest
Posts: n/a
 
      31st Aug 2004
Thanks Patrick,
The explanation was short and clear.
No problem with your English too.
Sincerely

"...Patrick" <http://cerbermail.com/?KPW0tTCjFw> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> a écrit dans le message de
> news:%23ms5H%(E-Mail Removed)...
> > 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
> > news:ub4%(E-Mail Removed)...
> > > 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" <(E-Mail Removed)> a écrit dans le message de
> > > news:(E-Mail Removed)...
> > > > 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 With Quote
 
...Patrick
Guest
Posts: n/a
 
      31st Aug 2004
you are welcome :-))

Bye

"Jack" <(E-Mail Removed)> a écrit dans le message de
news:Or%(E-Mail Removed)...
> Thanks Patrick,
> The explanation was short and clear.
> No problem with your English too.
> Sincerely
>
> "...Patrick" <http://cerbermail.com/?KPW0tTCjFw> wrote in message
> news:(E-Mail Removed)...
> > 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" <(E-Mail Removed)> a écrit dans le message de
> > news:%23ms5H%(E-Mail Removed)...
> > > 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
> > > news:ub4%(E-Mail Removed)...
> > > > 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" <(E-Mail Removed)> a écrit dans le message de
> > > > news:(E-Mail Removed)...
> > > > > 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
can I sort colored cells? Jack Microsoft Excel Programming 5 31st Aug 2004 11:15 AM
sort colored cells Rey Angeles Microsoft Excel Worksheet Functions 1 13th Nov 2003 10:47 PM
Cell right next to colored cells is automatically colored on entering a value Johan De Schutter Microsoft Excel Misc 6 12th Sep 2003 05:31 PM
Cell right next to colored cells is automatically colored on entering a value Johan De Schutter Microsoft Excel Programming 6 12th Sep 2003 05:31 PM
Re: Sort by colored cells David McRitchie Microsoft Excel Discussion 0 14th Aug 2003 05:40 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:08 AM.