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:
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
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