Do Count, CountBlank and CountIf work on arrays and multi-area ranges? Up to what level?
Do Count, CountBlank and CountIf work on arrays and multi-area ranges? Up to what level?
They are not part of arrays methods or properties, rather they are part of excel functions and can work on range/s.
Well, I started to fool around with them, and =Count({1,2,3}) worked. I couldn't get a working syntax for COUNTIF or COUNTBLANK
Hmm!
You are still using excel's functions, not arrays in VBA. If you meant be arrays in excel, yes, you can use them as you can use arrays with like in a sum function.
I don't understand "with like in a sum function" .
You have VBA arrays and excel functions arrays(Curly braces where you enter it with CTRL SHIFT plus ENTER. You can use the curly braces with any function in excel.
Hi all. COUNT, COUNTA, and SUM all work with either ranges or arrays! The various xxIF functions (COUNTIF, SUMIFS, etc.) only accept ranges, but can sometimes be replaced with a SUMPRODUCT construction using arrays.
EDIT: I'm not sure about COUNTA, it seems unpredictable.
Last edited by leelnich; 01-19-2018 at 04:13 PM.
Clicking the Add Reputation star below helpful posts is a great way to show your appreciation.
Please mark your threads as SOLVED upon conclusion (Thread Tools above Post # 1). - Lee
Thanks leelnich. So a VBA SUMIF Function, for example, with the facility to handle arrays might be useful?
There is no built-in VBA SUMIF Function. You can use most of Excel's Worksheet functions in Excel VBA projects (subject to the same limitations that apply on a worksheet) or you can program a User-Defined Function (UDF), which has it's own limitations, or you can write an event-driven or manually-called VBA procedure.
May I suggest you start a thread detailing a specific challenge/problem. You'll get more engaged help and perhaps a coding example or two for inspiration. Be sure to post a link to the new thread here so we can follow.
Last edited by leelnich; 01-19-2018 at 07:51 PM.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks