+ Reply to Thread
Results 1 to 5 of 5

what does the count function do and .end

  1. #1
    Registered User
    Join Date
    12-23-2011
    Location
    pomona, ca
    MS-Off Ver
    Excel 2010
    Posts
    36

    what does the count function do and .end

    Hi all,

    I ran into a spreadsheet that has a VBA code I don't undestand. From "LR =" to "select case right" is the part I don't understand. Can someone please explain what is happening with the rows.count end xlup part? Thanks!

    Please Login or Register  to view this content.
    Last edited by tlinton; 06-07-2012 at 11:46 AM.

  2. #2
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Help understanding a code

    I added comments to the code, but maybe this reference will also help

    Please Login or Register  to view this content.
    Last edited by jeffreybrown; 06-07-2012 at 12:36 PM.
    HTH
    Regards, Jeff

  3. #3
    Registered User
    Join Date
    12-23-2011
    Location
    pomona, ca
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: Help understanding a code

    Thanks so much Jeff. One last question for you. I'd like to take those rows and paste them into a new worksheet, but I dont know how to create a nested loop. I'm assuming I have to make another loop because excel wont know to move to the next row to paste the contents there instead of constantly pasting rows in say a1 of worksheet titled "breakdowns". Any ideas?

  4. #4
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: what does the count function do and .end

    I believe the most efficient method would be to have a formula in the last column of your data and match against the values you want to keep. (those value are on Sheet3 in a named range) If there is a match, the formula will return a number, and if not, then #N/A.

    No run a filter on the new column and transfer all those rows to the new sheet.

    If you want to delete the rows altogether then just uncomment the line in green. (remove the ')
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    12-23-2011
    Location
    pomona, ca
    MS-Off Ver
    Excel 2010
    Posts
    36

    Re: what does the count function do and .end

    Thanks for all your help Jeff!! I'll look at your last post tomorrow when i get in. i need to try to understand what you have going on!

+ Reply to Thread

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