Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tony,
try it like this: Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10],""" & i & """,C)" -- Hope that helps. Vergel Adriano "bony_tony" wrote: 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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Well that was simple
Why 3 " ? Doesn't seem to make sense to me Wouldn't the second " in the group of 3 close the string? Why is there 3rd one? T On May 4, 11:19 am, Vergel Adriano wrote: Tony, try it like this: Range("Amount").Column).FormulaR1C1 = "=SUMIF(C[-10],""" & i & """,C)" -- Hope that helps. Vergel Adriano "bony_tony" wrote: 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- Hide quoted text - - Show quoted text - |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to I use nested quotation marks for 'SUMIF' function in Excel. | Excel Programming | |||
Quote Marks Through VBA | Excel Discussion (Misc queries) | |||
How to keep quote marks for CSV in excel | Excel Discussion (Misc queries) | |||
SUMIF function in "Price quote with tax calculation" templae | Excel Worksheet Functions | |||
How do you look for quote marks? | Excel Programming |