+ Reply to Thread
Results 1 to 5 of 5

Advance Filter - define Dynamic CopyToRange below last row of existing data

  1. #1
    Registered User
    Join Date
    09-06-2012
    Location
    Hastings, NE
    MS-Off Ver
    Excel 2010
    Posts
    3

    Advance Filter - define Dynamic CopyToRange below last row of existing data

    Attempting to write VBA code to perform two separate Advance Filtering procedures using differing data ranges & criteria ranges. Advance Filter procedure #1 CopyToRange = worksheet2 cell A1:E1. The amount of data copied with this procedure will comprise 1 to 15 rows. I would like Advance Filter procedure #2 to copy data from Worksheet1 to Worksheet2 using a dynamic "CopyToRange". I would like the dynamic "CopyToRange" to identify the last row of data in Worksheet1 columns A:E then select the 2nd blank row below the existing data copied via Advanced Filter procedure 1. I have attempted to use but do not know how to insert the VBA code into the Advance Filter code.

    Following is the code I have tried to use which does not work. Errors out during 2nd Advance Filter procedure.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Advance Filter - define Dynamic CopyToRange below last row of existing data

    You have to use Set with range variables.

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Advance Filter - define Dynamic CopyToRange below last row of existing data

    But it looks like you're actually using imaxrows as a Long variable.

    Please Login or Register  to view this content.
    ^^If you dim imaxrows as a range, you can't add 2 to it as a range isn't a numeric variable.

  4. #4
    Registered User
    Join Date
    09-06-2012
    Location
    Hastings, NE
    MS-Off Ver
    Excel 2010
    Posts
    3

    Wink Re: Advance Filter - define Dynamic CopyToRange below last row of existing data

    Thank you!

    I will give that a try!

  5. #5
    Forum Contributor yay_excel's Avatar
    Join Date
    08-12-2011
    Location
    Canada
    MS-Off Ver
    2013
    Posts
    190

    Re: Advance Filter - define Dynamic CopyToRange below last row of existing data

    Any luck with your code?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Advance Filter with Data Validation
    By sats43 in forum Excel General
    Replies: 1
    Last Post: 03-26-2010, 05:07 AM
  2. [SOLVED] Pull data - Advance Filter
    By lil''bibbib in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  3. [SOLVED] Pull data - Advance Filter
    By Debra Dalgleish in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-06-2005, 04:05 AM
  4. Pull data - Advance Filter
    By lil''bibbib in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  5. [SOLVED] Pull data - Advance Filter
    By lil''bibbib in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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