Results 1 to 5 of 5

xlfiltercopy cant set range to last row =(

Threaded View

  1. #1
    Registered User
    Join Date
    01-19-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    8

    xlfiltercopy cant set range to last row =(

    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:
    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
    Last edited by Leith Ross; 01-20-2013 at 05:55 AM. Reason: Add Code Tagas

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1