Problem with Sumif and Right()

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to use sumif to add up a column of data. The hitch is I want to
compare the last four right characters of each line contained in the range.
My code is

xlrng2 & 4 are Dim as Range
xlApp.Range("m21") = xlApp.WorksheetFunction.SumIf(Right(xlRng2, 4), "CPCT",
xlRng4)
 
xlrng2 & 4 are Dim as Range
xlApp.Range("m21") = xlApp.WorksheetFunction.SumIf(xlRng2, "*CPCT",xlRng4)
 

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