View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default SUMIF not working when used in VBA

As PAPADOS discerningly observed (and I overlooked), you are mixing your form
of addressing.

worksheet.Range("B2").FormulaR1C1 = "=sumif(sheet1!A:A,rc[-1],sheet1!D:D)"

should be

worksheet.Range("B2").FormulaR1C1 = "=sumif(sheet1!C1,rc[-1],sheet1!C4)"

--
Regards,
Tom Ogilvy



"spud" wrote:

Tom - thanks. I used calculation both ways, and formatted the cells as 0.00
number format in the macro but the problem persists.