Copy & Paste

Nomis_Eswod

Board Regular
Joined
Jul 27, 2005
Messages
153
Hi,

I'm using the below code to copy and paste from 1 sheet to another:

Code:
Sub CopyPaste()

Dim rng As Range
Dim rng1 As Range
Dim ws As Worksheet
Dim ws1 As Worksheet

Set ws = Sheets("FilterSheet") 'destination sheet
Set ws1 = ActiveSheet
Set rng = ws1.Range("N1:O2") 'criteria
Set rng1 = ws.Range("A65000").End(xlUp) 'end row - will be destination

Range("A1:F" & xlLastRow).AdvancedFilter xlFilterCopy, CriteriaRange:=rng, CopyToRange:=rng1, Unique:=False

End Sub

Which is working, except it only copies the contents of column A. I.e. only row 3 meets the criteria, so it is only copying A3 into FilterSheet. Any ideas why this is, as I want the contents of A:F.

Many thanks in advance
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
It may be more helpful if you provide some examples (i.e. html shots) including the data that you expect to get copied that is not being copied.
 
Upvote 0

Forum statistics

Threads
1,215,584
Messages
6,125,673
Members
449,248
Latest member
wayneho98

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