Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50070

xlfiltercopy cant set range to last row =(

$
0
0
Hi to all of you,

my question has been asked in different ways already but somehow I cant get the
existing answers to work for me (bloody beginner).

I am using xlfiltercopy to copy paste information into another worksheet.
Afterwards I use a second code for deleting the just pasted data from the original sheet.

My Problem:
xlfiltercopy overwrites the old data..
I know there is a way to set the range to lastrow but I keep getting errors..

Any solutions?

My Code:
Code:

Sub Xing()
'
    Sheets("Project").Range("A1:T10").AdvancedFilter _
        Action:=xlFilterCopy, _
        CriteriaRange:=Sheets("Project").Range("X1:X2"), _
        CopyToRange:=Sheets("Xing").Range("A1:T10000"), _
        Unique:=False
        FindString = "A"
Set b = Range("N:N").Find(what:=FindString, lookat:=xlWhole)
While Not (b Is Nothing)
b.EntireRow.Delete
Set b = Range("N:N").Find(what:=FindString, lookat:=xlWhole)
Wend
       
End Sub


Viewing all articles
Browse latest Browse all 50070

Trending Articles