Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11
Default get value from last row of an autofilter array

I was graciously helped previously to help find a value in the first row of
an array when changing the autofilter, but now how do I figure out the last
row?

Here's the formula to find the first row.

=INDEX(B15:B48479,MATCH(1,(SUBTOTAL(3,OFFSET(B15:B 48479,ROW(B15:B48479)-MIN(ROW(B15:B48479)),0,1))*(B15:B48479<"")),0))

I want to be able to compare the first and last row and see if they are the
same or not.

Thanks so much for looking at this!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,124
Default get value from last row of an autofilter array

try this idea

Sub firstlast()
Set Rng = Range("a7:h100").SpecialCells(xlCellTypeVisible)
lr = Cells(Rows.Count, 1).End(xlUp).Row
'MsgBox lr
MsgBox Rng.Cells(1, 8)
MsgBox Cells(lr, 8)
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Christa" wrote in message
...
I was graciously helped previously to help find a value in the first row of
an array when changing the autofilter, but now how do I figure out the
last
row?

Here's the formula to find the first row.

=INDEX(B15:B48479,MATCH(1,(SUBTOTAL(3,OFFSET(B15:B 48479,ROW(B15:B48479)-MIN(ROW(B15:B48479)),0,1))*(B15:B48479<"")),0))

I want to be able to compare the first and last row and see if they are
the
same or not.

Thanks so much for looking at this!


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default get value from last row of an autofilter array

Try something like this (array entered):

=INDEX(B15:B48479,MAX((SUBTOTAL(3,OFFSET(B15:B4847 9,ROW(B15:B48479)-MIN(ROW(B15:B48479)),0,1)))*(ROW(B15:B48479)-MIN(ROW(B15:B48479))+1)))

With that large of a range expect this to be slow!

If the range is *permanent* and you will *never* insert new rows above the
range or add new rows to the end of the range you can eliminate a couple of
calculations that will save some resources:

=INDEX(B15:B48479,MAX(SUBTOTAL(3,OFFSET(B15:B48479 ,ROW(B15:B48479)-15,0,1))*ROW(B1:B48465)))

--
Biff
Microsoft Excel MVP


"Christa" wrote in message
...
I was graciously helped previously to help find a value in the first row of
an array when changing the autofilter, but now how do I figure out the
last
row?

Here's the formula to find the first row.

=INDEX(B15:B48479,MATCH(1,(SUBTOTAL(3,OFFSET(B15:B 48479,ROW(B15:B48479)-MIN(ROW(B15:B48479)),0,1))*(B15:B48479<"")),0))

I want to be able to compare the first and last row and see if they are
the
same or not.

Thanks so much for looking at this!



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
2007 Autofilter worse than 2003 Autofilter jsky Excel Discussion (Misc queries) 9 October 31st 07 12:14 AM
combination of AutoFilter and array formula? mark Excel Worksheet Functions 5 June 30th 07 09:44 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Manual AutoFilter - Vlookup, Index, Match, Array??? TEAM Excel Worksheet Functions 4 May 16th 06 02:49 AM
How to Sort within AutoFilter with Protection on (and AutoFilter . giblon Excel Discussion (Misc queries) 1 February 16th 06 12:23 PM


All times are GMT +1. The time now is 09:29 PM.

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

About Us

"It's about Microsoft Excel"