Computing.Net > Forums > Office Software > Excel VB formula not auto update

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

Excel VB formula not auto update

Reply to Message Icon

Original Message
Name: alpha314
Date: February 7, 2006 at 19:10:11 Pacific
Subject: Excel VB formula not auto update
OS: Win 2000
CPU/Ram: P4-1.6/256
Comment:

Someone help me using Excel VBAProject to write a formula:

Function mySum(firstCell As Range, interval As Integer, lastCell As Range)
temp = 0
For i = firstCell.Row To lastCell.Row Step interval
temp = temp + Cells(i, firstCell.Column)
Next i
mySum = temp
End Function

This is formula under Module1.

End line of Excel sheet, I enter :" mySum(c5,9,c275)".
Because I want adding every nine line number togather ( example = c5+c14+c23+c32 ... until to +c275 ).

Now this formaula is working. but problem is -- this formula can not auto update, this mean that every time I change or add new number, it can not sum and make new sum ( still keep old sum number ). I have to re-enter " mySum(c5,9,c275)" and enter, then new sum came out.

I don't know what is wrong? I don't know how to fix this problem ?
It shall auto update by that formula.

Someone told me I need setup run macro into module1.

I don't know how to do this let run macro into module1 ?


Report Offensive Message For Removal


Response Number 1
Name: seawatch
Date: February 11, 2006 at 05:39:01 Pacific
Reply: (edit)

What is the "9" in there for?

Larry

Today seems like a good day to chew through the restraints.


Report Offensive Follow Up For Removal







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Office Software Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 2 Days.
Discuss in The Lounge
Poll History




Data Recovery Software