Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I created a vba code to sum values in several columns. Column "D" thru "O" the code works when ran I see the correct values. Now lets say my code is placed in E18 and the formula is Sum(E15:E17) and the code will be similar for the other columns. There is a empty cell above and below the range I'm using. The value like I said is correct, until I do a save and now the formula show the range extended like this Sum(E13:E17). Now there is a value in E13, but I do not want that to be added to my total in E18. I'm using Excel 2007. Any thought would be appreciated. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 14, 1:20*am, Simon Lloyd
wrote: You can't use VBA code actually ina worksheet no matter which version of Excel you are using!, if you mean you have a formula then thats different, why extend the range to E13 when you don't want to include it? anyway =SUM(E13:E17)-E13 ;181099 Wrote: Hi, I created a vba code to sum values in several columns. Column "D" thru "O" the code works when ran I see the correct values. Now lets say my code is placed in E18 and the formula is Sum(E15:E17) and the code will be similar for the other columns. There is a empty cell above and below the range I'm using. The value like I said is correct, until I do a save and now the formula show the range extended like this Sum(E13:E17). Now there is a value in E13, but I do not want that to be added to my total in E18. I'm using Excel 2007. Any thought would be appreciated. -- Simon Lloyd Regards, Simon Lloyd 'The Code Cage' (http://www.thecodecage.com) ------------------------------------------------------------------------ Simon Lloyd's Profile:http://www.thecodecage.com/forumz/member.php?userid=1 View this thread:http://www.thecodecage.com/forumz/sh...ad.php?t=50076 Thanks for the reply. I know you can not use vba code in a worksheet so my question must be mis leading. The code I created is like this "Range("D" & Rlrow + Mynum + 1 & ":O" & Rlrow + Mynum + 1).FormulaR1C1 = "=SUM(r[-" & Mynum & "]c:rc)"" of which this forum helped me on. It place the correct formula in the worksheet and the value is correct. What happens (and i visually saw this) is when I saved the project the the values that was correct changed and up on looking at the formula in the cell it changed to include a cell 2 row above the range I desired. I can not understand why upon the save will and did change the formula. I hope this helps. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Formula Help-Excel 2007 | Excel Worksheet Functions | |||
Help with Excel 2007 Formula | Excel Discussion (Misc queries) | |||
Excel 2007 Formula and VBA help | Excel Discussion (Misc queries) | |||
Formula bar - Excel 2007 | Excel Discussion (Misc queries) | |||
formula excel 2007 | Excel Discussion (Misc queries) |