countif in VB

  • Thread starter Thread starter mohavv
  • Start date Start date
M

mohavv

Hi,

Can this be done shorter, without using cell B1

Range("B1").Formula = "=COUNTIF(A:A,""*Stock*"")"
Stock = Range("B1").Value
Range("B1").Clear

Cheers,

Harold
 
Dim Stock As Long
Stock = Application.CountIf(ActiveSheet.Range("a:a"), "*stock*")
MsgBox Stock
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top