I want to replace several worksheet formulas with their VBA equivalents, but I'm having problems with the conversion syntax. If someone could help me convert one of them, then hopefully I'll be able to tackle the others.
Here's an example Excel formula I have in cell B11:
The desired output should look something like:
Range("B11").Formula = "....."
Also, instead of referring to worksheet tab names "Sheet 1" and "Sheet 2", I would like to refer directly to their VBA sheet property names -- Sheet1 and Sheet2, respectively.
Any help?
Here's an example Excel formula I have in cell B11:
Code:
=COUNTIF(INDIRECT("'Sheet 1'!K4:K" & 'Sheet 2'!B54),"Pass")+COUNTIF(INDIRECT("'Sheet 1'!K4:K" & 'Sheet 2'!B54),"Fail")
The desired output should look something like:
Range("B11").Formula = "....."
Also, instead of referring to worksheet tab names "Sheet 1" and "Sheet 2", I would like to refer directly to their VBA sheet property names -- Sheet1 and Sheet2, respectively.
Any help?