wildcards with sumif/countif in macro/vba

  • Thread starter Thread starter Stefanie K.
  • Start date Start date
S

Stefanie K.

I know that you can use * as a wildcard with sumif and countif
functions in excel worksheets, but I was wondering if it's also
possible in macros/vba.

For example:
Application.SumIf(Range(Cells(1, 32), Cells(433, 32)), "*.aa.1t",
Range(Cells(1, 17), Cells(433, 17)))

Is this possible? If not, alternatives to this would be greatly
appreciated.
Thanks,
Stefanie
 
Stefanie,

If you tried it and it didn't work, it may be that the worksheet is not
active, so try fully qualifying

With Worksheets("Sheet1")
Application.SumIf(.Range(.Cells(1, 32), .Cells(433, 32)),
"*.aa.1t",.Range(.Cells(1, 17), .Cells(433, 17)))
End With


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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

Back
Top