sort within a sort in Excell 2003

sdear

Board Regular
Joined
May 23, 2010
Messages
96
I tried to get an answer to this by replying at the end of another
thread, but I've gone back since & noticed that the last entry was
a month or 2 old. My apologies.

I've got a macro going that has done sorting on multiple worksheets,
changed background color, etc. All kinds of good stuff ...

I've used this in several places in the macro to get the last row
of data: LR = .Cells(.Rows.Count, "G").End(xlUp).Row

Where I'm hung up, is in the middle of a sort (column G has all 0
values on top). What I need to capture, is the next row after the
bottom 0 value, so I can sort from there till the end of the data,
using column K.

I've been assuming I need to be tackling this a piece at at time,
since I need the 0 values on top & I'm not concerned with what's
happening in column K while sorting column G. Or is there a way
to get this all done in one swell foop?
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Weaver

Well-known Member
Joined
Sep 10, 2008
Messages
5,196
You could count the zeros in column G. (using worksheetfunction.countif()) then since you know where your data starts, you can figure out which row the zeros end on.

HTH
 

sdear

Board Regular
Joined
May 23, 2010
Messages
96
Thanks!
I've had my head so stuck on "there must be some kind of 'fancy' way to do this", that I've overlooked the obvious.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,398
Messages
5,831,404
Members
430,064
Latest member
Shahrukh kha

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
Top