I have this macro below that is auto-filtering my data and copying only specific columns to a new sheet.
The problem I am running into is that it is coping the entire column, including blank rows past the last row of data. How can I modify this to only copy the rows that have data?
Sub C_Closed_Inventory()
'
' Closed Macro
'
'
Sheets("Data").Select
Range("A1").Select
Range("$A$1").Autofilter Field:=3, Criteria1:="Closed"
Range("B:B,C:C,J:J,L:L,O:T,X:Z,AB:AC,AH:AK,AO:AS").EntireColumn.Hidden = True
Columns("A:AN").SpecialCells(xlCellTypeVisible).Copy Sheets("Closed Inventory").Range("A1")
Range("B:B,C:C,J:J,L:L,O:T,X:Z,AB:AC,AH:AK,AO:AS").EntireColumn.Hidden = False
ActiveSheet.ShowAllData
Bookmarks