Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
How do I replace the "A40" parameter with the nLastrow varable below? nLastrow = 100 objExcel.ActiveSheet.Range("D20").Formula = "=SUMIF (A4:A40,""'5734' "",B4:B40)" I've been trying many things with double-double quotes but nothing works. Thanks. |
#2
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
On Sep 10, 1:30*pm, circuit_breaker
wrote: Hi, How do I replace the "A40" parameter with the nLastrow varable below? * nLastrow = 100 * objExcel.ActiveSheet.Range("D20").Formula = "=SUMIF * (A4:A40,""'5734' "",B4:B40)" I've been trying many things with double-double quotes but nothing works. Thanks. This worked: ActiveSheet.Range("D20").formula="=SUMIF(A4:A"&nRo w &",""'5734'"",B4:B41)" |
#3
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
I'm not sure what you're doing, but even though excel is forgiving, I'd want my
ranges to be the same size. And are you sure you want those single quotes around that 5734? Just in case you want to try it: ActiveSheet.Range("D20").Formula _ = "=SUMIF(A4:A" & nRow & ",""5734"",B4:B" & nRow & ")" circuit_breaker wrote: On Sep 10, 1:30 pm, circuit_breaker wrote: Hi, How do I replace the "A40" parameter with the nLastrow varable below? nLastrow = 100 objExcel.ActiveSheet.Range("D20").Formula = "=SUMIF (A4:A40,""'5734' "",B4:B40)" I've been trying many things with double-double quotes but nothing works. Thanks. This worked: ActiveSheet.Range("D20").formula="=SUMIF(A4:A"&nRo w &",""'5734'"",B4:B41)" -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
objExcel.ActiveSheet.Range("D20").Formula = _
"=SUMIF(A4:A" & nLastRow & ",""'5734' "",B4:B" & nLastRow & ")" -- __________________________________ HTH Bob "circuit_breaker" wrote in message ... Hi, How do I replace the "A40" parameter with the nLastrow varable below? nLastrow = 100 objExcel.ActiveSheet.Range("D20").Formula = "=SUMIF (A4:A40,""'5734' "",B4:B40)" I've been trying many things with double-double quotes but nothing works. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Sumif based on two variable | Excel Discussion (Misc queries) | |||
SUMIF With Variable Consecutive Days | Excel Worksheet Functions | |||
SumIf for Variable Conditions | Excel Worksheet Functions | |||
how to use a variable for the criteria in a sumif function? | Excel Worksheet Functions | |||
Sumif with variable target | Excel Discussion (Misc queries) |