B
bony_tony
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
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