Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default last cell in filter

I want to use the filter option to filter several columns
of data. I then want a code that will select all the
filtered data from cell A1 to the last cell in the last
row and column of the filtered data.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default last cell in filter

If this is an autofilter and the headers are in row1, starting in column 1
then

Dim rng as Range, rng1 as Range
set rng = Activesheet.autofilter.Range.Columns1
set rng1 = rng.specialCells(xlVisible)
set rng1 = intersect(rng,rng1.EntireRow)
rng1.Select

If you just want to copy the visible cells


Dim rng as Range
set rng = Activesheet.autofilter.Range
rng.copy Destination:=Worksheets("Sheet2").Range("A1")

as an example. The default behavior is to only copy the visible cells.

--
Regards,
Tom Ogilvy


"scrabtree" wrote in message
...
I want to use the filter option to filter several columns
of data. I then want a code that will select all the
filtered data from cell A1 to the last cell in the last
row and column of the filtered data.



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
How to filter on a color of a cell [email protected] Excel Discussion (Misc queries) 3 April 27th 15 01:18 PM
Filter substring of a cell GregNga Excel Discussion (Misc queries) 1 December 22nd 08 10:32 PM
Adv Filter with Ref Cell JICDB Excel Worksheet Functions 1 August 22nd 07 03:45 PM
filter by colored cell? tina Excel Worksheet Functions 3 February 12th 07 10:34 PM
Can I filter just one cell instead of the whole row? Some Dude Excel Discussion (Misc queries) 6 July 27th 06 08:25 PM


All times are GMT +1. The time now is 01:18 AM.

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"