View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
StargateFan[_3_] StargateFan[_3_] is offline
external usenet poster
 
Posts: 171
Default "=ROW()-1" type of coding doesn't appear in a filter / is there coding that does?

The row coding works wonderfully. I've used it for several years now.
No matter what rows are deleted in a worksheet, the rows numbered with
this coding adapt and you don't have any numbering get out of order.

But I ran into a problem with one spreadsheet coded with this that I
had to create yesterday; the numbering jumps over the hidden rows that
aren't shown when the spreadsheet was filtered..

What I mean is that if I choose to filter the worksheet by a certain
criteria, the rows that don't follow this criteria are hidden, but the
rows that show up don't adapt to show the numbering true to the number
of rows now appearing. This is usu. a good thing, but not in this
particular speadsheet where the row numbering was to reflect how many
records fell under the criteria - either not filtered or filtered by
various criteria.

So what does this mean?

Let's say rows 1, 3, 7, and 10 show up in a filter out of rows 1, 2,
3, 4 ... 10. The rows that appear then are numbered 1, 3, 7 and 10
and not 1, 2, 3 and 4, which would be what is needed here. So row 3
would then become 2, 7 would become 3, and 10 would become 4. Then
when unfiltered, they'd go back to the numbering they fall under.

Again, most of the time this is good, but not in this one sheet.

Is there coding for row numbering that takes into account filtering
and adapts accordingly? It's a long shot, I know, but it would be
good. I don't know what I'll do if there isn't something like this.

p.s., I'm a real VB newbie, just to let everyone know ahead of time.
<g

Thanks!