AutoFilter Copy with Destination Paste Options

kc_native

Board Regular
Joined
Jan 20, 2009
Messages
176
I am using the following code in a procedure which is accomplishing what I need, but I was wondering if when the AutoFilter pastes the visible rows to another destination (In a tab I call Clipboard), it paste values. Is there a way to modify the code to make the paste special, with formulas? I have tried adding the standard ".PasteSpecial Paste:=xlPasteFormulas" after Range("A1"), but it blows up the code.

Code:
With ActiveSheet.Range(Cells(1, 1), Cells(Cells(Rows.Count, 1).End(xlUp).Row, LastCol + 1))
        .AutoFilter Field:=2, Criteria1:=StoredArrayString, Operator:=xlFilterValues
        .SpecialCells(xlCellTypeVisible).Copy Destination:=Sheets("Clip Board").Range("A1")
End With

Thanks for any help or education you can lend me.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I don't know if it will help with the pasting but you do not need to use

.SpecialCells(xlCellTypeVisible).Copy

You can just .copy with autofilter
 
Upvote 0
I don't know if it will help with the pasting but you do not need to use

.SpecialCells(xlCellTypeVisible).Copy

You can just .copy with autofilter

I thought that .SpecialCells(xlCellTypeVisible) was necessary to copy just the filtered rows and not all rows in the data set.
 
Upvote 0

Forum statistics

Threads
1,216,030
Messages
6,128,418
Members
449,449
Latest member
Quiet_Nectarine_

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top