+ Reply to Thread
Results 1 to 11 of 11

Autofilter for Unique values - changes paste location issue

  1. #1
    Registered User
    Join Date
    03-25-2009
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    12

    Autofilter for Unique values - changes paste location issue

    I would like to start by saying i am pretty much a novice on this stuff so the coding is pretty clunky.

    I have a workbook with multiple tabs. Each worksheet can have 2 or many rows and 1 or many values in the invoice number field. In each worksheet, I need to document each invoice number and the amount to be paid. I have the below 2 macros that can do the job but I haven't been able to figure out how to make the paste location dependent on the location of the last populated row.

    Thanks in advance.

    Please Login or Register  to view this content.
    Last edited by bk77; 06-27-2011 at 03:43 PM.

  2. #2
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Autofilter for Unique values - changes paste location issue

    Hi bk77

    If you want a tested solution, post your workbook (with code) so we can "see" what's going on. Before and after is always helpful. You're apparently using a recorded macro which is always a good starting point. However, recorded macros always leave a lot of detritus around...like "select".

    Now, looking at your code I see that you're defining "LastRow" as
    Please Login or Register  to view this content.
    but I don't see "LastRow" used in the code.

    You may wish to explore code like this
    Please Login or Register  to view this content.
    and/or
    Please Login or Register  to view this content.
    Let me know how I can help.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  3. #3
    Registered User
    Join Date
    03-25-2009
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Autofilter for Unique values - changes paste location issue

    Thanks for the pointers on using the LastRow language in the formulas. I was at a loss on how do to that. My code now looks like this.

    Please Login or Register  to view this content.
    I had some issues with the autofill on the formula if there is more than 1 unique value and the subsequent summing of those $$ values. I would assume that I could use another lastrow designation in another macro I could call. Is that the best solution or could I do it all in the one above?

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Autofilter for Unique values - changes paste location issue

    Hi bk77

    I don't see AutoFill in your code and I can't tell by reading your code what it is you're trying to do. I'll be glad to help you trouble shoot if you'll share a sample file of what you have and what you'd like it to be.

  5. #5
    Registered User
    Join Date
    03-25-2009
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Autofilter for Unique values - changes paste location issue

    Quote Originally Posted by jaslake View Post
    Hi bk77

    I don't see AutoFill in your code and I can't tell by reading your code what it is you're trying to do. I'll be glad to help you trouble shoot if you'll share a sample file of what you have and what you'd like it to be.
    I took it out of the code above because it was erroring out. I have attached a test file.

    The idea would be to autofill the formula and then sum the totals

    Thanks!
    Attached Files Attached Files

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Autofilter for Unique values - changes paste location issue

    Hi bk77

    This code is in the attached...it appears to do as you require.
    Please Login or Register  to view this content.
    Let me know of issues.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    03-25-2009
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Autofilter for Unique values - changes paste location issue

    Working well with the exception if there is only 1 unique value. Then the autofill portion is erroring out.

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Autofilter for Unique values - changes paste location issue

    Hi bk77

    Ha...well you had THAT working before. Easy enough to fix...I'll back this afternoon.

  9. #9
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Autofilter for Unique values - changes paste location issue

    Hi bk77

    See if this does better
    Please Login or Register  to view this content.
    Let me know of issues.

  10. #10
    Registered User
    Join Date
    03-25-2009
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: Autofilter for Unique values - changes paste location issue

    Perfect! Thanks so much!

  11. #11
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Autofilter for Unique values - changes paste location issue

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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