Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to write a program which will use the formula
("=SUMIF(AA8:AA208,3,C8:C208)" in a loop, except that I'd like to change the integer "3" in the formula to a variable so that I can increase this value each time through the loop. The program works as long as I leave the value an integer "3". "4", etc. But I can't make it work with a variable. Can someone give me a boost that might help me with this problem? Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Posting your code would have been helpful. Assuming your variable's name is
MyVar, I think this is what you are looking for.. MyVar = 4 <whatever you are assigning to = "=SUMIF(AA8:AA208," & MyVar & ",C8:C208" Rick "Ed" wrote in message ... I'm trying to write a program which will use the formula ("=SUMIF(AA8:AA208,3,C8:C208)" in a loop, except that I'd like to change the integer "3" in the formula to a variable so that I can increase this value each time through the loop. The program works as long as I leave the value an integer "3". "4", etc. But I can't make it work with a variable. Can someone give me a boost that might help me with this problem? Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks very much Rick. I'll give it a try. "Rick Rothstein (MVP - VB)" wrote in message ... Posting your code would have been helpful. Assuming your variable's name is MyVar, I think this is what you are looking for.. MyVar = 4 <whatever you are assigning to = "=SUMIF(AA8:AA208," & MyVar & ",C8:C208" Rick "Ed" wrote in message ... I'm trying to write a program which will use the formula ("=SUMIF(AA8:AA208,3,C8:C208)" in a loop, except that I'd like to change the integer "3" in the formula to a variable so that I can increase this value each time through the loop. The program works as long as I leave the value an integer "3". "4", etc. But I can't make it work with a variable. Can someone give me a boost that might help me with this problem? Thanks |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this:
"=SUMIF(AA8:AA208," & variable & ",C8:C208)" HTH, Matthew Pfluger "Ed" wrote: I'm trying to write a program which will use the formula ("=SUMIF(AA8:AA208,3,C8:C208)" in a loop, except that I'd like to change the integer "3" in the formula to a variable so that I can increase this value each time through the loop. The program works as long as I leave the value an integer "3". "4", etc. But I can't make it work with a variable. Can someone give me a boost that might help me with this problem? Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do i put a formula in a macro to run a program | Excel Worksheet Functions | |||
My excel program will not let me edit in the formula bar. | Excel Discussion (Misc queries) | |||
Program to make cell a formula | Excel Programming | |||
Program formula Add On | Excel Programming | |||
Updating the formula by program | Excel Programming |