Consulting

Results 1 to 1 of 1

Thread: Copy Paste hide columns of Filtered data

  1. #1

    Copy Paste hide columns of Filtered data

    Column D is hidden, hidden columns are unable to copy and paste the filter. But it will unhide column D works. I hope to respond to hide.



    PHP Code:
    Sub FilterValues()
        
    'Filter TP & IL
        Application.ScreenUpdating = False
        If Sheets("Sheet1").AutoFilterMode = True Then Sheets("Sheet1").AutoFilterMode = False
        Sheets("Sheet1").Range("A3:D" & Cells(Rows.Count,  "A").End(xlUp).Row).AutoFilter Field:=1, Criteria1:=Array("IL", "TP"),  Operator:=xlFilterValues
        Range("D4:D" & Cells(Rows.Count, 1).End(xlUp).Row).SpecialCells(xlCellTypeVisible).Select
        Selection.EntireColumn.Hidden = True
        Selection.Copy
        With Sheets("Sheet2").Range("B4")
        .PasteSpecial xlPasteValues
        End With
        Application.CutCopyMode = False
        Sheets("Sheet1").AutoFilterMode = False
        Application.ScreenUpdating = True
    End Sub 
    Attached Files Attached Files

Posting Permissions

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