View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jeff Jeff is offline
external usenet poster
 
Posts: 921
Default Problem with Sumif and Right()

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)