Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
hi all!
i have a cell with a formula in it ie cell C1 =sumif(a1:a10,"B",B1:B10) this formula is written with vba code how can i reference this cell using cells(rowNum,colNum) - and update it to be =sumif(a1:a10,"B",B1:B10)+1 i want to be able to do something similar to cells(rowNum,colNum)=cells(rowNum,colNum)+1 but with the resulting formula above (hope this makes sense!) J |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
J
one way: Range("C1").Formula = Range("C1").Formula & "+1" Regards Trevor "Gixxer_J_97" wrote in message ... hi all! i have a cell with a formula in it ie cell C1 =sumif(a1:a10,"B",B1:B10) this formula is written with vba code how can i reference this cell using cells(rowNum,colNum) - and update it to be =sumif(a1:a10,"B",B1:B10)+1 i want to be able to do something similar to cells(rowNum,colNum)=cells(rowNum,colNum)+1 but with the resulting formula above (hope this makes sense!) J |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Perhaps,
rowStart = 1 rowEnd = 10 colStart = 1 colEnd = 2 Range("C1").FormulaR1C1 = "=SUMIF(R" & rowStart & "C" & colStart & _ ":R" & rowEnd & "C" & colStart & _ ",""B"",R" & rowStart & "C" & colEnd & _ ":R" & rowEnd & "C" & colEnd & ")" -- HTH RP (remove nothere from the email address if mailing direct) "Gixxer_J_97" wrote in message ... hi all! i have a cell with a formula in it ie cell C1 =sumif(a1:a10,"B",B1:B10) this formula is written with vba code how can i reference this cell using cells(rowNum,colNum) - and update it to be =sumif(a1:a10,"B",B1:B10)+1 i want to be able to do something similar to cells(rowNum,colNum)=cells(rowNum,colNum)+1 but with the resulting formula above (hope this makes sense!) J |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to both!
Trevor's was the way i was looking for! In reality my formula is much much more complicated than the one i used. J "Bob Phillips" wrote: Perhaps, rowStart = 1 rowEnd = 10 colStart = 1 colEnd = 2 Range("C1").FormulaR1C1 = "=SUMIF(R" & rowStart & "C" & colStart & _ ":R" & rowEnd & "C" & colStart & _ ",""B"",R" & rowStart & "C" & colEnd & _ ":R" & rowEnd & "C" & colEnd & ")" -- HTH RP (remove nothere from the email address if mailing direct) "Gixxer_J_97" wrote in message ... hi all! i have a cell with a formula in it ie cell C1 =sumif(a1:a10,"B",B1:B10) this formula is written with vba code how can i reference this cell using cells(rowNum,colNum) - and update it to be =sumif(a1:a10,"B",B1:B10)+1 i want to be able to do something similar to cells(rowNum,colNum)=cells(rowNum,colNum)+1 but with the resulting formula above (hope this makes sense!) J |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need Help with Cell Manipulation | Excel Discussion (Misc queries) | |||
Help w/ Cell Manipulation | Excel Worksheet Functions | |||
Cell manipulation | Excel Programming | |||
Cell Manipulation | Excel Programming | |||
Cell Manipulation | Excel Programming |