Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
tanya
 
Posts: n/a
Default Numbering a Range Using Autofilter

This is driving me crazy! I have autofiltered a range, but want to be able
to number that range from 1 to xxx each time I apply a different filter. But
even though I have only set the auto filter up on the specific columns it
hides the whole row that is being filtered. I have tried converting the
range to a list that also does not work, and nor does using the ROW function.
Any ideas?
  #2   Report Post  
Posted to microsoft.public.excel.misc
Don Guillett
 
Posts: n/a
Default Numbering a Range Using Autofilter

One way. This will re-number the visible cells in col A

Sub numbervisible()
lr = Cells(Rows.Count, 1).End(xlUp).Row
Set myrng = Range("a2:a" & lr).SpecialCells(xlCellTypeVisible)
counter = 1
For Each c In myrng
c.Value = counter
counter = counter + 1
Next c
End Sub


--
Don Guillett
SalesAid Software

"tanya" wrote in message
...
This is driving me crazy! I have autofiltered a range, but want to be
able
to number that range from 1 to xxx each time I apply a different filter.
But
even though I have only set the auto filter up on the specific columns it
hides the whole row that is being filtered. I have tried converting the
range to a list that also does not work, and nor does using the ROW
function.
Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.misc
Debra Dalgleish
 
Posts: n/a
Default Numbering a Range Using Autofilter

You can use a formula to calculate the row number. For example, in
column A, enter the following:
=SUBTOTAL(3,$B$2:B2)

where column B contains no blank cells.
Copy the formula down to the last row of data.

Note: Don't use this formula in conjunction with the DataSubtotal
feature. When you choose to Remove Subtotals, it deletes the lines that
contain a Subtotal formula.

tanya wrote:
This is driving me crazy! I have autofiltered a range, but want to be able
to number that range from 1 to xxx each time I apply a different filter. But
even though I have only set the auto filter up on the specific columns it
hides the whole row that is being filtered. I have tried converting the
range to a list that also does not work, and nor does using the ROW function.
Any ideas?


--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html

  #4   Report Post  
Posted to microsoft.public.excel.misc
tanya
 
Posts: n/a
Default Numbering a Range Using Autofilter

Debra - thanks - does exactly what I want it to. Tanya

"Debra Dalgleish" wrote:

You can use a formula to calculate the row number. For example, in
column A, enter the following:
=SUBTOTAL(3,$B$2:B2)

where column B contains no blank cells.
Copy the formula down to the last row of data.

Note: Don't use this formula in conjunction with the DataSubtotal
feature. When you choose to Remove Subtotals, it deletes the lines that
contain a Subtotal formula.

tanya wrote:
This is driving me crazy! I have autofiltered a range, but want to be able
to number that range from 1 to xxx each time I apply a different filter. But
even though I have only set the auto filter up on the specific columns it
hides the whole row that is being filtered. I have tried converting the
range to a list that also does not work, and nor does using the ROW function.
Any ideas?


--
Debra Dalgleish
Contextures
http://www.contextures.com/tiptech.html


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate Range Names by worksheet FlaAl Excel Discussion (Misc queries) 0 May 24th 06 05:14 PM
How do you Identify text as a named range in excel DMDave Excel Discussion (Misc queries) 6 May 7th 06 11:48 PM
Help with using range names in sum function soteman2005 Excel Worksheet Functions 2 November 28th 05 04:43 PM
Array to named range conversion... i-Zapp Excel Discussion (Misc queries) 4 October 25th 05 09:09 PM
Cannot Expand Named Range - when size of the Range exceeds Snig Excel Discussion (Misc queries) 1 July 7th 05 01:46 PM


All times are GMT +1. The time now is 12:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"