+ Reply to Thread
Results 1 to 3 of 3

Select range after filter

Hybrid View

cmb80 Select range after filter 02-11-2013, 07:13 AM
:) Sixthsense :) Re: Select range after filter 02-11-2013, 07:28 AM
cmb80 Re: Select range after filter 02-11-2013, 12:17 PM
  1. #1
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Select range after filter

    Hi all, I would like to know the code to select and copy the displayed range in columns A:N after a filter is applied.

    The filter is used in column A, and i have the code that selects the first cell in column A - But i don;t know how to select across to column N - and all the rows that are shown (this amount will be changeable from 0 to 100+).

    I can't use the selection.end(xl to right) code as some of the cells maybe blank (so it won't highlight all columns from A to N)

    Any help much appreciated

    Here is the code i have already

    ActiveSheet.Range("$A:$N").AutoFilter Field:=1, Criteria1:= _
            xlFilterToday, Operator:=xlFilterDynamic
            
            Dim Rng As Range
        With ActiveSheet.AutoFilter
            Set Rng = .Range.Resize(.Range.Rows.Count - 1).Offset(1, 0)
            Rng.SpecialCells(xlCellTypeVisible).Cells(1, 1).Select
        End With
     
        
        Selection.Copy

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,788

    Re: Select range after filter

    ActiveSheet.Range("$A:$N").AutoFilter Field:=1, Criteria1:= _
            xlFilterToday, Operator:=xlFilterDynamic
    ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible).Select
    Selection.Copy
    or

    ActiveSheet.AutoFilter.Range.SpecialCells(xlCellTypeVisible).Copy


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    04-21-2009
    Location
    England
    MS-Off Ver
    Excel 2016
    Posts
    710

    Re: Select range after filter

    Thanks alot

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1