LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default "Sum" function as Macro


I've finally got it :

Code
-------------------
Sub sumf()
'simulation of sum function
S = 0
x = ActiveCell.Row()
x = x - 1
For i = x To 6 Step -1
If Cells(x, 6) < 0 Then
S = S + Cells(x, 6).Value
Else
S = S
End If
Next i
[sumall] = S
ActiveCell.FormulaR1C1 = "=SUM(sumall)"
End Sub

-------------------


but, if i change a value it doesn't change the sum automatically.
would have to run the code once again.
Any ideas???
thanks

--
orenfarh
-----------------------------------------------------------------------
orenfarhi's Profile: http://www.excelforum.com/member.php...fo&userid=1622
View this thread: http://www.excelforum.com/showthread.php?threadid=27633

 
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
Text "comparison" operator for "contains" used in an "IF" Function Pawaso Excel Worksheet Functions 4 April 4th 23 11:35 AM
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
"No RETURN() or HALT() function found on macro sheet." Will Excel Worksheet Functions 2 January 4th 07 10:10 PM
Is there a "last saved on date/user" macro/function for Excel 2003 Zliz Excel Discussion (Misc queries) 2 January 2nd 07 10:12 PM
Macro to concatenate into "B1" B2 thru B"x" based on new data in "Col A" Dennis Excel Discussion (Misc queries) 0 July 17th 06 02:38 PM


All times are GMT +1. The time now is 05: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"