+ Reply to Thread
Results 1 to 5 of 5

Counting should stop at blank cell

  1. #1
    Registered User
    Join Date
    10-06-2009
    Location
    Diemen, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    87

    Thumbs up Counting should stop at blank cell

    Good day friends,


    The code down below counts all cells from column A2 to I11.

    The problem; the code should stop counting if there is a blanc cell in a column and go to the next column to countinue .

    My query; how should the code be modified so it will stop counting if there is a blanc cell.


    Thank you for any help offered!

    Greetings from Roberto, The Netherlands


    Please Login or Register  to view this content.
    Last edited by roberto1111; 11-09-2009 at 01:26 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Counting should stop at blanc cell

    Not immediately clear if there are certain guarantees regards data types in each column nor if there is always a blank, what the content of row 12 is etc... but a fairly robust approach would be

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-06-2009
    Location
    Diemen, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Counting should stop at blanc cell

    Hello DonkeyOte,

    Thank you for this great code you provide me with.

    Can you explain to me what ' 10^10 ' stands for?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Counting should stop at blank cell

    10^10 is used to generate a big number, a bigger number than would otherwise be found in the lookup_vector
    (which in essence ensures you return the last number found in the lookup_vector [or associated value from result_vector if in use - not so here])

  5. #5
    Registered User
    Join Date
    10-06-2009
    Location
    Diemen, The Netherlands
    MS-Off Ver
    Excel 2007
    Posts
    87

    Thumbs up Re: Counting should stop at blank cell

    Alrightie then.

    Thanks again DonkeyOte!

+ 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