Is there a way to only copy certain columns from an auto filter?
With the below example the active sheet has 8 columns of data G, L, P, R, S, T, W, AB (other columns have been hidden)
When I copy the data, I don’t want to copy column W & AB so that only 6 columns of data will be moved to sheet 1.
I get lost on offset and resize and the answer might be as simple as changing a figure but can’t seem to get it to work. The below code works other than not copying W & AB.
Sub NewCopy()
With ActiveSheet.AutoFilter.Range
.Offset(1, 0).Resize(.Rows.Count - 1).Copy
Sheets(1).Range("B" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
End Sub
With the below example the active sheet has 8 columns of data G, L, P, R, S, T, W, AB (other columns have been hidden)
When I copy the data, I don’t want to copy column W & AB so that only 6 columns of data will be moved to sheet 1.
I get lost on offset and resize and the answer might be as simple as changing a figure but can’t seem to get it to work. The below code works other than not copying W & AB.
Sub NewCopy()
With ActiveSheet.AutoFilter.Range
.Offset(1, 0).Resize(.Rows.Count - 1).Copy
Sheets(1).Range("B" & Rows.Count).End(xlUp).Offset(1, 0).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End With
End Sub