+ Reply to Thread
Results 1 to 5 of 5

counting blanc rows is not working

  1. #1
    Valued Forum Contributor
    Join Date
    02-21-2010
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007
    Posts
    502

    counting blanc rows is not working

    I am trying to count the blanc rows after the loop that creates them to finally delete them. Being new to VB I failed to figure out the correct code (marked in red). Please help


    Please Login or Register  to view this content.
    Last edited by dschmitt; 03-03-2010 at 01:08 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: counting blanc rows is not working

    Maybe like so instead:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Valued Forum Contributor
    Join Date
    02-21-2010
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007
    Posts
    502

    Re: counting blanc rows is not working

    yes, this is working.

    What I don't understand is:
    1. how the error is detected
    2. GoTo 0

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: counting blanc rows is not working

    The specialcells(blanks) will generate an error if there are no blanks. I told the macro to push past even if there is an error, else an error message might occur, which we don't want.

    Then Goto 0 just turns back on normal error-messaging behavior.

    Since we blew through a possible error when we resolved the delRng range, it might be equal to nothing, so we test for that. If the delRng is equal to nothing, we quit, else we delete the entire row of all the cells that make up the delRng.

  5. #5
    Valued Forum Contributor
    Join Date
    02-21-2010
    Location
    Tokyo, Japan
    MS-Off Ver
    Excel 2007
    Posts
    502

    Re: counting blanc rows is not working

    OK, thank you. Now I understand

+ 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