I have a variable num_d which I've declared as an Integer. Its value should be the result of this worksheet formula:
=COUNTA(INDIRECT("Sheet1!A"& 2*),INDIRECT("Sheet1!B"& 2*),INDIRECT("Sheet1!C"& 2*))
*2 is just an example here - this value could be anything.
I'd like to avoid populating a cell with the result of this formula, and instead assign num_d directly.
How can I translate the worksheet function into VBA?
Thanks in advance.
Use
WorksheetandRangeobjects:If the row number is a variable, then just concatenate it: