sort within a sort in Excell 2003

sdear

Board Regular
Joined
May 23, 2010
Messages
90
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?
 

Some videos you may like

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

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
90
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.
 

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Threads
1,106,719
Messages
5,513,011
Members
408,930
Latest member
Michealker

This Week's Hot Topics

  • Sort code advice please
    Hi, I have the code below which im trying to edit but getting a little stuck. This was the original code which worked fine,columns A-F would sort...
  • SUMPRODUCT with nested If statement
    Hi everyone, Hope you're all well. I'm hoping someone will be able to point me in the right direction with a problem I'm having with a SUMPRODUCT...
  • VBA - simple sort is killing me!
    Hello all! This should be so easy, but not for me, apparently! I have a table of data that can be of varying lengths and widths. My current macro...
  • Compare Two Lists
    I have two Lists and I need to be able to Identify differences between them. List 100 comes from a workbook - the other is downloaded form the...
  • Formula that deducts points for each code I input.
    I am trying to create a formula that will have each student in my class start at 100 points and then for each code that I enter (PP for Poor...
  • Conditional formatting formula required for day of week and a value
    Hi, I have a really simple spreadsheet where column A is the date, column B is the activity total shown as a number and column C states the day of...
Top