count nonempty cells in a row excel vba -


having trouble syntax while trying count nonempty cells in row(in example, row two), excel vba.

have tried .rows(2:2) .rows(2) .cells(b1:b999) received errors three.

    dim intcount integer     intcount = counta(activesheet.rows(2, 2)) 

counta not vba function, worksheet function. try this:

dim intcount integer intcount = application.worksheetfunction.counta(activesheet.rows(2)) 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -