I have a file........see enclosed.
I want to count the number of non-blank cells in a range from A to Z along a given row.
Then once the loop is done i want it to tell me the row which had the most non-empty cells but its not working.
I have a file........see enclosed.
I want to count the number of non-blank cells in a range from A to Z along a given row.
Then once the loop is done i want it to tell me the row which had the most non-empty cells but its not working.
Hi welchs101, how you display this is up to you but the following procedure will count everything (even the headers).![]()
Please Login or Register to view this content.
If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.
---Keep on Coding in the Free World---
FYI - you can use WorksheetFunction.CountA() to count the number of non-empty cells in a given range.
If you want a count of both empty and non empty cells, try:![]()
Please Login or Register to view this content.
Wow that shortens the code!Nice one Colin!![]()
Please Login or Register to view this content.
hi Mordred,
your code is cool!
But i was trying to count the number of non-blank cells in a given range and that range was a row from about A to Z. I then wanted to know which row had the most non-blank entries. Your code, while very very cool (and i can use it in another place), counts the number of non-blank cells in the "entire" range of a current region where c5 is in that region. I am not guaranteed that c5 is in the region of interest.
Hi welchs101, The following code works base on you selecting a whole row and then running the code, which is also based on the workbook you provided where the first fill column is at C.![]()
Please Login or Register to view this content.
thanks for your help
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks