View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
MSweetG222 MSweetG222 is offline
external usenet poster
 
Posts: 158
Default =ROW-1, =SUBTOTAL(3,$B$2:$B2) don't work in hidden rows.

Hello StargateFan,

Maybe I am not understanding your issue. This is a function formula (not
code).
You cut and pasted this formula into cell B2 and copied it down to all of
the cells in question? If yes, then you will have to post a small
sample/layout of your worksheet. Thx.

Thx
MSweetG222



"StargateFan" wrote:

On Wed, 22 Feb 2006 19:27:26 -0800, "MSweetG222"
wrote:

Oops -
That formula assumes you place it in A2.
For B2 change to: =IF(ROW()=2,1,B1+1)
(I have assumed you have header row in A1 and you don't want row 1 to be #'d
& you want row 2 to be numbered 1.)

--
Thx
MSweetG222


Hi, thanks!

I used this code and then tried hiding some rows but the row numbers
jump same as with the all the other codes and don't compensate for the
hidden rows. What am I doing wrong, pls?

I have XL2K on a new Windows 2000 installation and it's the first time
I've had W2K at home. Am finding that it's doing weird things to my
standard files that Win98SE never did, so wondering if there's a
problem with the Windows version number if this code works for you.

Pls advise and thanks. :oD

"MSweetG222" wrote:

I have made several assumptions here, but try this formula:

=IF(ROW()=2,1,A1+1)

Is that what you need?

Thx
MSweetG222



"StargateFan" wrote:

In A2, =ROW-1 works until one filters rows. Also in A2,
=SUBTOTAL(3,$B$2:$B2) does work with filters but doesn't work with
hidden rows.

Is there code that will number rows consecutively even if one
_filters_ AND/OR manually _hides_ rows?? I've googled and googled the
archives but nothing comes up for this particular dual requirement.

Thanks. :oD