View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Tim Childs[_4_] Tim Childs[_4_] is offline
external usenet poster
 
Posts: 31
Default Code Snippet - Data Filter

Hi Ron

thanks for that - intersed to see that filter range expands if cells add in
adjacent area

best wishes

Tim

"Ron Rosenfeld" wrote in message
...
On Sat, 23 Feb 2013 10:29:33 -0000, "Tim Childs"
wrote:

Hi

If there is a worksheet with a table of data and other data beneath that,
is
there a property associated with the Data Filter method that will return
the
last row included in the filtered data i.e. the last row in scope of the
filtering, so it is not dependent on the current criteria set, just on the
basis of where the filter is including as being in scope. For the
avoidance
of doubt, it is the last row the user included when the filter area was
created initially.

Many thanks

Tim


If I understand you correctly, at least in Excel 2007+, the range property
of the autofilter object will return the range to which the autofilter
applies. However, empirical testing shows that if there are lines added
immediately below this range, they will be added to the autofilter.range.

If the "other data beneath" is separated by at least one blank row, then
the Range property should give you what you want.