Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default VBA Formula Excel 2007

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default VBA Formula Excel 2007

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula Help-Excel 2007 formulaconfusion Excel Worksheet Functions 2 February 21st 10 08:57 PM
Help with Excel 2007 Formula Marilyn Excel Discussion (Misc queries) 3 November 5th 09 10:09 AM
Excel 2007 Formula and VBA help Preschool Mike Excel Discussion (Misc queries) 5 August 25th 09 12:45 AM
Formula bar - Excel 2007 Idoia Excel Discussion (Misc queries) 6 April 21st 09 07:24 PM
formula excel 2007 john Excel Discussion (Misc queries) 3 November 28th 08 10:14 PM


All times are GMT +1. The time now is 06:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"