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
 

Some videos you may like

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.

colbymack

Active Member
Joined
Jul 14, 2005
Messages
333
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,119,128
Messages
5,576,253
Members
412,709
Latest member
Rishu
Top