Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Hi,
I want to replace the "A40" parameter in the below formula with a variable because this parameter should be dynamic. In short, I want to replace the "A40" nLastRow variable. "I'm using vbScript and not Excel's VBA. Here's the code I use: nLastrow = objExcel.ActiveSheet.Range("B4").End(-4121).Row objExcel.ActiveSheet.Range("D20").Formula = "=SUMIF (A4:A40,""'5734'"",B4:B40)" ' This works. 'This fails: objExcel.ActiveSheet.Range("D"").Formula = "=SUMIF (A4:A&nLastRow,""'5734'"",B4:B40)" ' This works. Thanks for your help. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
variable substitution in a formula linking to external workbook | Excel Discussion (Misc queries) | |||
variable substitution in a formula | Excel Discussion (Misc queries) | |||
Parameter Query Cell substitution | Excel Discussion (Misc queries) | |||
Cell Formula substitution. | Excel Discussion (Misc queries) | |||
why does ON = Ambiguous in substitution formula? | Excel Worksheet Functions |