ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Countif in VBA (https://www.excelbanter.com/excel-programming/306908-countif-vba.html)

Lee Hunter[_2_]

Countif in VBA
 
Will someone please show me an example of using countif
as a worksheet function in VBA.

I have used the "Find" function to determine the starting
row for the countif. It is stored in a var "c"

What is the correct syntax to count the number of rows
with a "1" in column B, starting with the row "c".

Thanks for your help.


Frank Kabel

Countif in VBA
 
Hi
try
msgbox application.worksheetfunction.countif(Range("B2 & c &
":B10000"),"1")

--
Regards
Frank Kabel
Frankfurt, Germany

"Lee Hunter" schrieb im
Newsbeitrag ...
Will someone please show me an example of using countif
as a worksheet function in VBA.

I have used the "Find" function to determine the starting
row for the countif. It is stored in a var "c"

What is the correct syntax to count the number of rows
with a "1" in column B, starting with the row "c".

Thanks for your help.



No Name

Countif in VBA
 
Thanks Frank.

I received a syntax error. I believe the " are
unbalanced.

Did you mean to use Range("B"&c&":B1000").....?

This too results in a syntax error.

Can you see the probllem?

Thanks once again for your help.
-----Original Message-----
Hi
try
msgbox application.worksheetfunction.countif(Range("B2 &

c &
":B10000"),"1")

--
Regards
Frank Kabel
Frankfurt, Germany

"Lee Hunter"

schrieb im
Newsbeitrag news:583401c48154$4dcbe2e0

...
Will someone please show me an example of using countif
as a worksheet function in VBA.

I have used the "Find" function to determine the

starting
row for the countif. It is stored in a var "c"

What is the correct syntax to count the number of rows
with a "1" in column B, starting with the row "c".

Thanks for your help.


.


Tom Ogilvy

Countif in VBA
 
You have guessed the typo, but created another problem by not putting a
space around the ampersand.

Range("B"&c&":B1000")

should be

Range("B" & c & ":B1000")

But then I showed you that already.

--
Regards,
Tom Ogilvy

wrote in message
...
Thanks Frank.

I received a syntax error. I believe the " are
unbalanced.

Did you mean to use Range("B"&c&":B1000").....?

This too results in a syntax error.

Can you see the probllem?

Thanks once again for your help.
-----Original Message-----
Hi
try
msgbox application.worksheetfunction.countif(Range("B2 &

c &
":B10000"),"1")

--
Regards
Frank Kabel
Frankfurt, Germany

"Lee Hunter"

schrieb im
Newsbeitrag news:583401c48154$4dcbe2e0

...
Will someone please show me an example of using countif
as a worksheet function in VBA.

I have used the "Find" function to determine the

starting
row for the countif. It is stored in a var "c"

What is the correct syntax to count the number of rows
with a "1" in column B, starting with the row "c".

Thanks for your help.


.





All times are GMT +1. The time now is 05:26 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com