View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
bony_tony bony_tony is offline
external usenet poster
 
Posts: 76
Default Entering quote marks in SUMIF function

Hi,
I'm trying to enter a variable as the criteria for the sumif function
from my macro. I can't seem to get the criteria in quote marks...

Cells(ActiveSheet.UsedRange.Rows.Count,
Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10],"" & i & "",C)"
enters the formula as =SUMIF(B:B," & i & ",L:L), and

Cells(ActiveSheet.UsedRange.Rows.Count,
Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10]," & i & ",C)"
enters the formula as SUMIF(B:B,ABC123,L:L).

I need SUMIF(B:B,"ABC123",L:L).

Can someone help please?
I've ran out of logical soultions..

Tony