Macro for copying filtered slicers data
Results 1 to 2 of 2

Thread: Macro for copying filtered slicers data
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Oct 2017
    Posts
    25
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Macro for copying filtered slicers data

    I had filters on a Excel sheet and had a macro which would copy across only the filtered data to another workbook.

    I recently introduced slicers to the data, however the macro now copies across all the data and not just the filtered data from the slicers.
    Anyone know how I an over come this?

  2. #2
    Board Regular Worf's Avatar
    Join Date
    Oct 2011
    Location
    Rio, Brazil
    Posts
    3,676
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    2 Thread(s)

    Default Re: Macro for copying filtered slicers data

    An example:

    Code:
    Sub Act_Sheet_to_other_sheet()
    Dim r As Range, dest As Worksheet, i%
    Set dest = Sheets("sheet2")                                 ' destination sheet
    Set r = ActiveSheet.UsedRange.SpecialCells(xlCellTypeVisible)
    For i = 1 To r.Areas.Count
        r.Areas(i).Copy
        dest.Cells(dest.Range("a" & Rows.Count).End(xlUp).Row + 1, 1).PasteSpecial _
        xlPasteValues, xlNone, False, False
    Next
    End Sub
    Excel 2013 / Windows 8.1 (home)
    Excel 2013 / windows 7 (work)


Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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