#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Summation

Hello,

I need a little help with a special vba summation code -
if its possible.

I currently use vba code to force cells to autosum within
macros and keep the formula. Such as:

Sub DoAutoSum()
Dim x As CommandBarControl
Set x = CommandBars.FindControl(ID:=226)
If Val(Application.Version) = 10 Then _
Set x = x.Controls(1)
x.Execute
If Selection.Cells.Count = 1 Then
x.Execute 'Again to exit edit mode if only one cell
is selected
End If
End Sub


The change I want to make is when the formula shows up in
Excel. It currently shows something like this:
=SUM(I12:I19)

However for my special situation I would Like it to show
something like this:
=SUM(I18,I17,I16,I15,I14,I13,I12)

Is this possible using a similar line of vba code as above.

And a very basic question - (I just cannot remember) is
there a limit to how long this formula can be in Excel.


Thank You

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
Summation [email protected] Excel Discussion (Misc queries) 2 November 28th 07 05:12 PM
summation ExcelQuestion Excel Worksheet Functions 11 June 27th 07 02:28 AM
Summation from a to b jeblunk Excel Worksheet Functions 3 December 4th 05 02:14 PM
VBA code to perform summation and product summation 21MSU[_2_] Excel Programming 4 May 17th 04 07:19 PM
Summation John Excel Programming 0 May 6th 04 07:01 PM


All times are GMT +1. The time now is 04:19 PM.

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

About Us

"It's about Microsoft Excel"