Sorting Highlighted cells

kbreen

New Member
Joined
Aug 26, 2002
Messages
7
"Nate0" responded to an earlier post to my challenge in sorting by highlighted rows.
I tried to use a simplified function:
Function Clr(myRng As range)
Clr=myRng.Interior.ColorIndex
End Function
.... but I don't know what to do just after the paste function(shift+F3). Within the "Function name" area, I choose "Module2.Clr", however when I hit "OK" I'm further prompted to put a formula there "=Module2.Clr()"
That's where I'm stumped! Please help.
Thx,
Kev
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Hi Kev,

I didn't see your original post, but I'm sure what NateO intended was for you to use his function to give you a color index value in each row that you could use to sort on. For example, if you have colored the cell in column A on each row you can use the formula

=Clr(A1)

in a cell in some other column in that row to return the color index of cell A1. You can then fill this formula down to give you a color index in each row, and can then sort on this column containing these indices.

I hope this explains it.

Damon
 
Upvote 0
but I'm sure what NateO intended was for you to use his function to give you a color index value in each row that you could use to sort on.

This is correct, thanks Damon. Kev, if you go back to the original thread:

http://216.92.17.166/board/viewtopic.php?topic=24147&forum=2

You can click on the numbers in column c in both the pre-sorted and post-sorted worksheets to see the formulae in the formula bar.

Simply place the function in a normal module and copy the first formula down throughout your range as Damon mentioned.

Also, no worries, but it's easier if you respond to the original thread.

Hope this helps.
 
Upvote 0
NATE O,
I finally figured it out...it was very simple. Thanks for your help and sorry for being a moron.
--KB
 
Upvote 0

Forum statistics

Threads
1,225,069
Messages
6,182,663
Members
453,131
Latest member
BeLocke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top